Пример #1
0
 protected function _mapMongoModelToModel(array $mongoModel)
 {
     $mongoModel = parent::_mapMongoModelToModel($mongoModel);
     unset($mongoModel['_id']);
     if ($mongoModel['timestamp']) {
         $dateTime = new \DateTime();
         $dateTime->setTimestamp($mongoModel['timestamp']->sec);
         $mongoModel['timestamp'] = $dateTime->format(\DateTime::ATOM);
     }
     return $mongoModel;
 }
Пример #2
0
 protected function _mapMongoModelToModel(array $mongoModel)
 {
     $mongoModel = parent::_mapMongoModelToModel($mongoModel);
     $sessionModel = array();
     if (isset($mongoModel['id'])) {
         $sessionModel['sessionId'] = $mongoModel['id'];
     }
     if (isset($mongoModel['rawData']['Zend_Auth']['storage'])) {
         $sessionModel += $mongoModel['rawData']['Zend_Auth']['storage'];
     }
     if (isset($mongoModel['logout'])) {
         $sessionModel['logout'] = $mongoModel['logout'];
     }
     if (isset($mongoModel['messages'])) {
         $sessionModel['messages'] = $mongoModel['messages'];
     }
     if (isset($mongoModel['metadata'])) {
         $sessionModel['metadata'] = $mongoModel['metadata'];
     }
     return $sessionModel;
 }