original_string: public function _write($pId, $pData)
      {
          Agl::validateParams(array(
              'String' => $pData
          ));
  
          $access = time();
  
          if (! isset($this->_items[$pId])) {
              $this->_items[$pId] = Agl::getModel(self::DB_COLLECTION);
              $this->_items[$pId]->loadByRealid($pId);
          }
  
          $this->_items[$pId]
              ->setRealid($pId)
              ->setAccess($access)
              ->setData($pData);
  
          if (! $this->_items[$pId]->getId()) {
              $this->_items[$pId]->insert();
          } else {
              $this->_items[$pId]->save();
          }
  
          return true;
      }
code: public function _write($pId, $pData)
      {
          Agl::validateParams(array(
              'String' => $pData
          ));
  
          $access = time();
  
          if (! isset($this->_items[$pId])) {
              $this->_items[$pId] = Agl::getModel(self::DB_COLLECTION);
              $this->_items[$pId]->loadByRealid($pId);
          }
  
          $this->_items[$pId]
              ->setRealid($pId)
              ->setAccess($access)
              ->setData($pData);
  
          if (! $this->_items[$pId]->getId()) {
              $this->_items[$pId]->insert();
          } else {
              $this->_items[$pId]->save();
          }
  
          return true;
      }
code_tokens: public function _write ( $ pId , $ pData ) { Agl :: validateParams ( array ( 'String' => $ pData ) ) ; $ access = time ( ) ; if ( ! isset ( $ this -> _items [ $ pId ] ) ) { $ this -> _items [ $ pId ] = Agl :: getModel ( self :: DB_COLLECTION ) ; $ this -> _items [ $ pId ] -> loadByRealid ( $ pId ) ; } $ this -> _items [ $ pId ] -> setRealid ( $ pId ) -> setAccess ( $ access ) -> setData ( $ pData ) ; if ( ! $ this -> _items [ $ pId ] -> getId ( ) ) { $ this -> _items [ $ pId ] -> insert ( ) ; } else { $ this -> _items [ $ pId ] -> save ( ) ; } return true ; }
docstring: Write the session to the database.
  
  @param string $pId Session id
  @param string $pData Session data
  @return bool
docstring_tokens: Write the session to the database .