Пример #1
0
 protected static function mapper(array $row, $alias = 'user')
 {
     $model = new \Rebond\Core\User\Model(false);
     if (isset($row[$alias . 'Id'])) {
         $model->setId($row[$alias . 'Id']);
     }
     if (isset($row[$alias . 'Username'])) {
         $model->setUsername($row[$alias . 'Username']);
     }
     if (isset($row[$alias . 'Email'])) {
         $model->setEmail($row[$alias . 'Email']);
     }
     if (isset($row[$alias . 'Password'])) {
         $model->setPassword($row[$alias . 'Password']);
     }
     if (isset($row[$alias . 'Firstname'])) {
         $model->setFirstname($row[$alias . 'Firstname']);
     }
     if (isset($row[$alias . 'Lastname'])) {
         $model->setLastname($row[$alias . 'Lastname']);
     }
     if (isset($row[$alias . 'AvatarId'])) {
         $model->setAvatarId($row[$alias . 'AvatarId']);
         $model->setAvatar(\Rebond\Core\Media\Data::join($row, $alias . '_avatar'));
     }
     if (isset($row[$alias . 'IsAdmin'])) {
         $model->setIsAdmin($row[$alias . 'IsAdmin']);
     }
     if (isset($row[$alias . 'IsDev'])) {
         $model->setIsDev($row[$alias . 'IsDev']);
     }
     if (isset($row[$alias . 'Status'])) {
         $model->setStatus($row[$alias . 'Status']);
     }
     if (isset($row[$alias . 'CreatedDate'])) {
         $model->setCreatedDate($row[$alias . 'CreatedDate']);
     }
     if (isset($row[$alias . 'ModifiedDate'])) {
         $model->setModifiedDate($row[$alias . 'ModifiedDate']);
     }
     return $model;
 }
Пример #2
0
 protected static function mapper(array $row, $alias = 'x')
 {
     $model = new \Rebond\App\Standard\Model(false);
     if (isset($row[$alias . 'AppId'])) {
         $model->setAppId($row[$alias . 'AppId']);
     }
     if (isset($row[$alias . 'MediaId'])) {
         $model->setMediaId($row[$alias . 'MediaId']);
         $model->setMedia(\Rebond\Core\Media\Data::join($row, $alias . '_media'));
     }
     if (isset($row[$alias . 'Description'])) {
         $model->setDescription($row[$alias . 'Description']);
     }
     return parent::mapEntity($model, $row);
 }