Exemplo n.º 1
0
 /**
  * Get the RiakObject
  *
  * @param string $id Session ID
  * 
  * @return RiakObject
  */
 private function _session($id)
 {
     if (!$this->_session instanceof RiakObject) {
         $this->_session = $this->_bucket->get($id);
         // Create a new session if it doesn't exist
         if (!$this->_session->exists()) {
             $data = array('data' => '', 'atime' => time());
             $this->_session = $this->_bucket->newObject($id, $data)->store();
         }
     }
     return $this->_session;
 }