當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。