当前位置: 首页>>代码示例>>PHP>>正文


PHP AdminForm::toModel方法代码示例

本文整理汇总了PHP中AdminForm::toModel方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminForm::toModel方法的具体用法?PHP AdminForm::toModel怎么用?PHP AdminForm::toModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AdminForm的用法示例。


在下文中一共展示了AdminForm::toModel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: toModel

 public function toModel(Model $model, $fields = null, $ignore = null)
 {
     $model->Permissions = array();
     if (!empty($this->controller->request->data['permission_id'])) {
         $permissionIds = $this->controller->request->data['permission_id'];
         foreach ($permissionIds as $permissionId) {
             $model->Permissions[] = new Permission($permissionId);
         }
     }
     return parent::toModel($model, $fields, $ignore);
 }
开发者ID:Ephigenia,项目名称:harrison,代码行数:11,代码来源:AdminUserGroupForm.php

示例2: toModel

 public function toModel(Model $model, $fields = null, $ignore = null)
 {
     if ($model->behaviors->hasBehavior('Flagable')) {
         if ($this->hasField('allowComments')) {
             $model->setFlag(NodeFlag::ALLOW_COMMENTS, $this->allowComments->value());
         }
         if ($this->hasField('allowRSS')) {
             $model->setFlag(NodeFlag::ALLOW_RSS, $this->allowRSS->value());
         }
     }
     return parent::toModel($model, $fields, $ignore);
 }
开发者ID:Ephigenia,项目名称:harrison,代码行数:12,代码来源:AdminNodeForm.php

示例3: toModel

 public function toModel(Model $model, $fields = null, $ignore = null)
 {
     if ($model->behaviors->hasBehavior('Flagable')) {
         if ($this->hasField('allowComments')) {
             $model->setFlag(BlogPostFlag::ALLOW_COMMENTS, $this->allowComments->value());
         }
         if ($this->hasField('sticky')) {
             $model->setFlag(BlogPostFlag::STICKY, $this->sticky->value());
         }
     }
     // saving tags
     $this->Tags = new IndexedArray();
     $tags = array_filter(array_unique(preg_split('/\\s+/i', $this->tags->value())));
     foreach ($tags as $tag) {
         $Tag = new Tag(array('name' => $tag, 'model' => DBQuery::quote($model->name)));
         $Tag->set('BlogPostTag', array('model' => DBQuery::quote($model->name)));
         $model->Tags[] = $Tag;
     }
     return parent::toModel($model, $fields, $ignore);
 }
开发者ID:Ephigenia,项目名称:harrison,代码行数:20,代码来源:AdminBlogPostForm.php


注:本文中的AdminForm::toModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。