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


PHP Order::setAttributes方法代码示例

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


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

示例1: actionAdmin

 public function actionAdmin()
 {
     $model = new Order('search');
     $model->unsetAttributes();
     if (isset($_GET['Order'])) {
         $model->setAttributes($_GET['Order']);
     }
     $this->render('admin', array('model' => $model));
 }
开发者ID:ngdvan,项目名称:lntguitar,代码行数:9,代码来源:OrderController.php

示例2: actionIndex

 public function actionIndex()
 {
     $model = new Order('search');
     $model->unsetAttributes();
     // clear any default values
     if (Yii::app()->getRequest()->getQuery('Order')) {
         $model->setAttributes(Yii::app()->getRequest()->getQuery('Order'));
     }
     $this->render('index', ['model' => $model]);
 }
开发者ID:RonLab1987,项目名称:43berega,代码行数:10,代码来源:OrderBackendController.php

示例3: actionCreate

 public function actionCreate()
 {
     $model = new Order();
     $description = new OrderDescription();
     //$order_option_value = new OrderOptionValue;
     $this->performAjaxValidation(array($model, $description), 'order-form');
     if (isset($_POST[$this->modelName])) {
         $model->setAttributes($_POST[$this->modelName]);
         $description->setAttributes($_POST[$this->modelName . 'Description']);
         $suc = Yii::t('info', 'Order was successfully created');
         $err = Yii::t('info', 'Could not create Order');
         $description->order_id = 0;
         $description->locale_code = Yii::app()->getLanguage();
         if ($this->validateOrder($model, $description)) {
             if ($model->save()) {
                 $description->order_id = $model->id;
                 $description->save();
                 $this->orderSave($model);
                 Yii::app()->user->setFlash(TbHtml::ALERT_COLOR_SUCCESS, $suc);
                 if (Yii::app()->getRequest()->getIsAjaxRequest()) {
                     $this->renderPartial('_view', array('model' => $model, 'description' => $description, 'customer' => $this->_ordercustomer, 'orderProduct' => $this->_orderproduct), false, true);
                     Yii::app()->end();
                 } else {
                     $this->redirect(array('view', 'id' => $model->id));
                 }
             } else {
                 Yii::app()->user->setFlash(TbHtml::ALERT_COLOR_ERROR, $err);
             }
         }
     }
     if (Yii::app()->getRequest()->getIsAjaxRequest()) {
         $this->renderPartial('_form_order', array('model' => $model, 'description' => $description, 'customer' => $this->_ordercustomer, 'orderproduct' => $this->_orderproduct), false, true);
         Yii::app()->end();
     }
     $this->render('create', array('model' => $model, 'description' => $description, 'customer' => $this->_ordercustomer, 'orderproduct' => $this->_orderproduct));
 }
开发者ID:Rudianasaja,项目名称:cycommerce,代码行数:36,代码来源:OrderController.php

示例4: actionGetLoadingAddressList

 /**
  * Ajax action. Get list of Supplier Addresses.
  *
  * @throws CHttpException
  */
 public function actionGetLoadingAddressList()
 {
     if (Yii::app()->request->isPostRequest) {
         $order = new Order();
         $order->setAttributes($_POST['Order']);
         $supplierAddressesList = SupplierAddresses::getListBySupplierId($order->supplier_id);
         foreach ($supplierAddressesList as $value => $name) {
             echo CHtml::tag('option', ['value' => $value], CHtml::encode($name));
         }
     } else {
         throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
     }
     Yii::app()->end();
 }
开发者ID:septembermd,项目名称:n1,代码行数:19,代码来源:OrderController.php

示例5: actionRefreshDetails

 public function actionRefreshDetails()
 {
     $model = new Order();
     $description = new OrderDescription();
     $sess = Yii::app()->user->getState('order_product');
     $model->setAttributes($_POST[$this->modelName]);
     $description->setAttributes($_POST[$this->modelName . 'Description']);
     $this->renderPartial('_details', array('orderproduct' => $sess, 'model' => $model, 'description' => $description), false, true);
     Yii::app()->end();
 }
开发者ID:Rudianasaja,项目名称:cycommerce,代码行数:10,代码来源:OrderController.php


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