Psecio\Gatekeeper\DataSource::save PHP Метод

save() абстрактный публичный Метод

Save the given model
abstract public save ( Modler\Model $model ) : boolean
$model Modler\Model Model instance
Результат boolean Success/fail of action
    public abstract function save(\Modler\Model $model);

Usage Example

Пример #1
0
 /**
  * Save the new token to the data source
  *
  * @param string $token Token string
  * @param \Psecio\Gatekeeper\UserModel $user User model instance
  * @return boolean|\Psecio\Gatekeeper\AuthTokenModel Success/fail of token creation or AuthTokenModel instance
  */
 public function saveToken($token, \Psecio\Gatekeeper\UserModel $user)
 {
     $expires = new \DateTime($this->expireInterval);
     $tokenModel = new \Psecio\Gatekeeper\AuthTokenModel($this->datasource, array('token' => $token, 'userId' => $user->id, 'expires' => $expires->format('Y-m-d H:i:s')));
     $result = $this->datasource->save($tokenModel);
     return $result === false ? false : $tokenModel;
 }
All Usage Examples Of Psecio\Gatekeeper\DataSource::save