本文整理汇总了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));
}
示例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]);
}
示例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));
}
示例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();
}
示例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();
}