示例#1
0
 protected static function mapper(array $row, $alias = 'page')
 {
     $model = new \Rebond\Cms\Page\Model(false);
     if (isset($row[$alias . 'Id'])) {
         $model->setId($row[$alias . 'Id']);
     }
     if (isset($row[$alias . 'ParentId'])) {
         $model->setParentId($row[$alias . 'ParentId']);
         $model->setParent(\Rebond\Cms\Page\Data::join($row, $alias . '_parent'));
     }
     if (isset($row[$alias . 'TemplateId'])) {
         $model->setTemplateId($row[$alias . 'TemplateId']);
         $model->setTemplate(\Rebond\Cms\Template\Data::join($row, $alias . '_template'));
     }
     if (isset($row[$alias . 'LayoutId'])) {
         $model->setLayoutId($row[$alias . 'LayoutId']);
         $model->setLayout(\Rebond\Cms\Layout\Data::join($row, $alias . '_layout'));
     }
     if (isset($row[$alias . 'Title'])) {
         $model->setTitle($row[$alias . 'Title']);
     }
     if (isset($row[$alias . 'Css'])) {
         $model->setCss($row[$alias . 'Css']);
     }
     if (isset($row[$alias . 'Js'])) {
         $model->setJs($row[$alias . 'Js']);
     }
     if (isset($row[$alias . 'InNavHeader'])) {
         $model->setInNavHeader($row[$alias . 'InNavHeader']);
     }
     if (isset($row[$alias . 'InNavSide'])) {
         $model->setInNavSide($row[$alias . 'InNavSide']);
     }
     if (isset($row[$alias . 'InSitemap'])) {
         $model->setInSitemap($row[$alias . 'InSitemap']);
     }
     if (isset($row[$alias . 'InBreadcrumb'])) {
         $model->setInBreadcrumb($row[$alias . 'InBreadcrumb']);
     }
     if (isset($row[$alias . 'InNavFooter'])) {
         $model->setInNavFooter($row[$alias . 'InNavFooter']);
     }
     if (isset($row[$alias . 'FriendlyUrlPath'])) {
         $model->setFriendlyUrlPath($row[$alias . 'FriendlyUrlPath']);
     }
     if (isset($row[$alias . 'FriendlyUrl'])) {
         $model->setFriendlyUrl($row[$alias . 'FriendlyUrl']);
     }
     if (isset($row[$alias . 'Redirect'])) {
         $model->setRedirect($row[$alias . 'Redirect']);
     }
     if (isset($row[$alias . 'Class'])) {
         $model->setClass($row[$alias . 'Class']);
     }
     if (isset($row[$alias . 'Permission'])) {
         $model->setPermission($row[$alias . 'Permission']);
     }
     if (isset($row[$alias . 'DisplayOrder'])) {
         $model->setDisplayOrder($row[$alias . 'DisplayOrder']);
     }
     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;
 }