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


PHP Type::setAttributes方法代码示例

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


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

示例1: setAttributes

 /**
  * Sets attributes from SQL result row to object.
  *
  * @param array $row data from DB
  *
  * @return void
  */
 protected function setAttributes(array $row)
 {
     parent::setAttributes($row);
     if (isset($row['blueprintTypeID'])) {
         $this->producedFromBlueprintId = (int) $row['blueprintTypeID'];
     }
 }
开发者ID:Covert-Inferno,项目名称:iveeCore,代码行数:14,代码来源:Manufacturable.php

示例2: actionCreate

 /**
  *
  */
 public function actionCreate()
 {
     $model = new Type();
     if (($data = Yii::app()->getRequest()->getPost('Type')) !== null) {
         $model->setAttributes($data);
         if ($model->save() && $model->storeTypeAttributes(Yii::app()->getRequest()->getPost('attributes', []))) {
             Yii::app()->getUser()->setFlash(yupe\widgets\YFlashMessages::SUCCESS_MESSAGE, Yii::t('StoreModule.store', 'Product type is created'));
             $this->redirect((array) Yii::app()->getRequest()->getPost('submit-type', ['create']));
         }
     }
     $this->render('create', ['model' => $model, 'availableAttributes' => Attribute::model()->findAll()]);
 }
开发者ID:alextravin,项目名称:yupe,代码行数:15,代码来源:TypeBackendController.php

示例3: actionCreate

 public function actionCreate()
 {
     $model = new Type();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (($data = Yii::app()->getRequest()->getPost('Type')) !== null) {
         $model->setAttributes($data);
         $model->categories = serialize(Yii::app()->getRequest()->getPost('categories'));
         if ($model->save()) {
             $model->setTypeAttributes(Yii::app()->getRequest()->getPost('attributes'));
             Yii::app()->user->setFlash(yupe\widgets\YFlashMessages::SUCCESS_MESSAGE, Yii::t('StoreModule.type', 'Тип товара создан.'));
             $this->redirect((array) Yii::app()->getRequest()->getPost('submit-type', ['create']));
         }
     }
     //$criteria = new CDbCriteria();
     //$criteria->addNotInCondition('id', CHtml::listData($model->attributeRelation, 'attribute_id', 'attribute_id'));
     $availableAttributes = Attribute::model()->findAll();
     $this->render('create', ['model' => $model, 'availableAttributes' => $availableAttributes]);
 }
开发者ID:RonLab1987,项目名称:43berega,代码行数:19,代码来源:TypeBackendController.php

示例4: setAttributes

 /**
  * Sets attributes from SQL result row to object.
  *
  * @param array $row data from DB
  *
  * @return void
  */
 protected function setAttributes(array $row)
 {
     parent::setAttributes($row);
     $this->productId = (int) $row['productTypeID'];
     $this->maxProductionLimit = (int) $row['maxProductionLimit'];
 }
开发者ID:Covert-Inferno,项目名称:iveeCore,代码行数:13,代码来源:Blueprint.php

示例5: setAttributes

 /**
  * Sets attributes from SQL result row to object. Overwrites inherited method.
  * 
  * @param array $row data from DB
  * 
  * @return void
  */
 protected function setAttributes(array $row)
 {
     //call parent method
     parent::setAttributes($row);
     if (isset($row['marketGroupID'])) {
         $this->marketGroupID = (int) $row['marketGroupID'];
     }
 }
开发者ID:draivsolregard,项目名称:lmeve-ci,代码行数:15,代码来源:Sellable.php

示例6: actionAdmin

 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Type('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Type'])) {
         $model->setAttributes($_GET['Type']);
     }
     $this->render('admin', array('model' => $model));
 }
开发者ID:jessesiu,项目名称:GigaDBV3,代码行数:13,代码来源:AdminDatasetTypeController.php

示例7: actionIndex

 /**
  * Управление Типами форм обучения.
  *
  * @return void
  */
 public function actionIndex()
 {
     $roles = ['1'];
     $role = \Yii::app()->user->role;
     if (array_intersect($role, $roles)) {
         $model = new Type('search');
         $model->unsetAttributes();
         // clear any default values
         if (Yii::app()->getRequest()->getParam('Type') !== null) {
             $model->setAttributes(Yii::app()->getRequest()->getParam('Type'));
         }
         $this->render('index', ['model' => $model]);
     } else {
         throw new CHttpException(403, 'Ошибка прав доступа.');
     }
 }
开发者ID:shipovalovyuriy,项目名称:spasibeaucoup,代码行数:21,代码来源:TypeController.php


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