Exemplo n.º 1
0
 protected static function mapEntity(Model $model, $row, $alias = 'content')
 {
     if (isset($row[$alias . 'Id'])) {
         $model->setId($row[$alias . 'Id']);
     }
     if (isset($row[$alias . 'ModuleId'])) {
         $model->setModuleId($row[$alias . 'ModuleId']);
         $model->setModule(\Rebond\Cms\Module\Data::join($row, $alias . '_module'));
     }
     if (isset($row[$alias . 'ContentGroup'])) {
         $model->setContentGroup($row[$alias . 'ContentGroup']);
     }
     if (isset($row[$alias . 'FilterId'])) {
         $model->setFilterId($row[$alias . 'FilterId']);
         $model->setFilter(\Rebond\Cms\Filter\Data::join($row, $alias . '_filter'));
     }
     if (isset($row[$alias . 'AuthorId'])) {
         $model->setAuthorId($row[$alias . 'AuthorId']);
         $model->setAuthor(\Rebond\Core\User\Data::join($row, $alias . '_author'));
     }
     if (isset($row[$alias . 'PublisherId'])) {
         $model->setPublisherId($row[$alias . 'PublisherId']);
         $model->setPublisher(\Rebond\Core\User\Data::join($row, $alias . '_publisher'));
     }
     if (isset($row[$alias . 'Title'])) {
         $model->setTitle($row[$alias . 'Title']);
     }
     if (isset($row[$alias . 'UrlFriendlyTitle'])) {
         $model->setUrlFriendlyTitle($row[$alias . 'UrlFriendlyTitle']);
     }
     if (isset($row[$alias . 'UseExpiration'])) {
         $model->setUseExpiration($row[$alias . 'UseExpiration']);
     }
     if (isset($row[$alias . 'GoLiveDate'])) {
         $model->setGoLiveDate($row[$alias . 'GoLiveDate']);
     }
     if (isset($row[$alias . 'ExpiryDate'])) {
         $model->setExpiryDate($row[$alias . 'ExpiryDate']);
     }
     if (isset($row[$alias . 'PublishedDate'])) {
         $model->setPublishedDate($row[$alias . 'PublishedDate']);
     }
     if (isset($row[$alias . 'Version'])) {
         $model->setVersion($row[$alias . 'Version']);
     }
     if (isset($row[$alias . 'CreatedDate'])) {
         $model->setCreatedDate($row[$alias . 'CreatedDate']);
     }
     if (isset($row[$alias . 'ModifiedDate'])) {
         $model->setModifiedDate($row[$alias . 'ModifiedDate']);
     }
     return $model;
 }
Exemplo n.º 2
0
 public function delete()
 {
     parent::delete();
     return Data::deleteById($this->getAppId());
 }