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


PHP CFormModel::setAttributes方法代码示例

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


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

示例1: setAttributes

 /**
  * Обработка полей birthday
  */
 public function setAttributes($values, $safeOnly = true)
 {
     parent::setAttributes($values, $safeOnly);
     if (!$this->birthday_day && !$this->birthday_month && !$this->birthday_year) {
         $birthday = strtotime($this->birthday);
         $this->birthday_day = date('j', $birthday);
         $this->birthday_month = date('n', $birthday);
         $this->birthday_year = date('Y', $birthday);
     }
 }
开发者ID:Diakonrus,项目名称:fastweb-yii,代码行数:13,代码来源:RegistrationForm.php

示例2: setAttributes

 public function setAttributes($values, $safeOnly = true)
 {
     if ($this->getScenario() == 'registration') {
         if ($values['type'] == UserModel::TYPE_JURIST) {
             $this->setScenario('reg_jurist');
         } else {
             $this->setScenario('reg_client');
         }
     }
     return parent::setAttributes($values, $safeOnly);
 }
开发者ID:snipesn,项目名称:pravoved,代码行数:11,代码来源:UserForm.php

示例3: setAttributes

 public function setAttributes(array $array)
 {
     parent::setAttributes($array);
     $personArr = $this->person;
     if (array_key_exists("types", $personArr)) {
         $this->_types = $personArr["types"];
         unset($personArr["types"]);
     }
     $this->person = new CPerson();
     $this->person->setAttributes($personArr);
     if (!is_null($this->to_tabel)) {
         $this->person->to_tabel = $this->to_tabel;
     }
     if (!is_null($this->is_slave)) {
         $this->person->is_slave = $this->is_slave;
     }
 }
开发者ID:Rustam44,项目名称:ASUPortalPHP,代码行数:17,代码来源:CPersonForm.class.php

示例4: setAttributes

 /**
  * Sets the attribute values in a massive way.
  * @param array $values attribute values (name=>value) to be set.
  * @param boolean $safeOnly whether the assignments should only be done to the safe attributes.
  * A safe attribute is one that is associated with a validation rule in the current {@link scenario}.
  * @see getSafeAttributeNames
  * @see attributeNames
  */
 public function setAttributes($values, $safeOnly = true)
 {
     if ($safeOnly) {
         return parent::setAttributes($values, true);
     }
     foreach ($values as $attribute => $value) {
         $this->{$attribute} = $value;
     }
 }
开发者ID:hezhiwen,项目名称:YiiSolr,代码行数:17,代码来源:ASolrDocument.php

示例5: setAttributes

 /**
  * Besides standard mass setter translate values back to model attributes for
  * active record.
  * @param array $values
  * @param boolean $updateActiveModel we don't want to update model attributes after find
  */
 public function setAttributes($values, $updateActiveModel = true)
 {
     parent::setAttributes($values, true);
     if ($updateActiveModel) {
         $this->updateModelAttributes();
     }
 }
开发者ID:nncrypted,项目名称:Sommelier,代码行数:13,代码来源:FrApiResource.php

示例6: setAttributes

 /**
  * @param array $values
  * @param bool $safeOnly
  */
 public function setAttributes($values, $safeOnly = true)
 {
     parent::setAttributes($values, $safeOnly);
     $this->status = isset($values["status"]) && $values["status"] != "" ? IntVal($values["status"]) : null;
 }
开发者ID:andi98,项目名称:antragsgruen,代码行数:9,代码来源:AdminAntragFilterForm.php


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