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;
    }
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;
    }
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 ; }
Write the session to the database.

@param string $pId Session id
@param string $pData Session data
@return bool
Write the session to the database .