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


PHP CFormModel::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Scenario is required for this model, and also we need info about model, that we will be validating
  * 
  * @access public
  */
 public function __construct($model, $emailAtt, $nameAtt = null, $scenario = 'both')
 {
     if (empty($emailAtt)) {
         throw new CException('$emailAtt can not be empty! Please specify email attribute name.');
     }
     $this->email = $model->{$emailAtt};
     if (empty($nameAtt)) {
         $scenario = 'email';
     } else {
         $this->username = $model->{$nameAtt};
     }
     // correcting scenarios, if some of fields is not empty
     if ($this->scenario == 'both') {
         if (!empty($this->email)) {
             $this->scenario = 'username';
         }
         if (!empty($this->username)) {
             $this->scenario = 'email';
         }
     }
     $this->nameAtt = $nameAtt;
     $this->emailAtt = $emailAtt;
     $this->_model = $model;
     parent::__construct($scenario);
 }
开发者ID:EurekaSolutions,项目名称:proyectoestudio,代码行数:30,代码来源:HUserInfoForm.php

示例2: __construct

 public function __construct($scenario = '', $rec_id = null, $user_id = null, $slotid = null)
 {
     parent::__construct($scenario);
     $this->_recId = $rec_id;
     $this->_userId = $user_id;
     $this->_slotId = $slotid;
 }
开发者ID:eneelkant,项目名称:oprecx-project,代码行数:7,代码来源:InterviewSlotForm.php

示例3: __construct

 /**
  * constructor with arguments
  */
 public function __construct($orderId, $userId)
 {
     parent::__construct();
     $this->orderId = $orderId;
     $this->encryptedOrderId = Yii::app()->getSecurityManager()->hashData($orderId);
     $selectedOrders = null;
     //if order id belongs to current user and is in 'order_start' status
     //(other status mean order has already crossed the checkout process once)
     //as order id's input has been added to checkout action to facilitate the
     //order resumption. Note: As order is being modified or created in this function
     //do check before any POST or GET if order can be modified. Order can be modified
     //only and only if it is in 'order-start' status.
     $selectedOrders = AOrder::model()->findAll(array('order' => 'id', 'condition' => 'is_deleted = "no" AND ordered_by2user_details = ' . $userId . ' AND  order_unique_id = "' . $orderId . '" ' . ' AND  status = "order_start" '));
     if (!isset($selectedOrders) || count($selectedOrders) < 1) {
         $this->render('cart_error', array('errorMessage' => "Either this page does not exists or has expired or you are not allowed to view this page.", 'link' => CHtml::normalizeUrl(array('cart/checkout'))));
         Yii::app()->end();
     }
     $this->totalItemsInOrder = 0;
     foreach ($selectedOrders as $row) {
         $this->tiffinPriceTimeSelectionArr[] = new TiffinPriceTimeSelectionForm($row, $this->encryptedOrderId);
         $this->destinationLocality = $row->destination_locality;
         $this->totalItemsInOrder = $this->totalItemsInOrder + $row->num_of_units;
     }
     $this->totalAmountInWallet = AppCommonWallet::getTotalAmountInWalletForUser($userId);
     $this->amountUsedFromWallet = 0;
     $this->userId = $userId;
 }
开发者ID:ankitbishtkec,项目名称:generic-ecommerce-website,代码行数:30,代码来源:CheckoutSecondStageForm.php

示例4: __construct

 public function __construct($fields)
 {
     foreach ($fields as $field => $rules) {
         $this->_fields[$field] = null;
         $this->_rules[$field] = $rules;
     }
     parent::__construct();
 }
开发者ID:Telemedellin,项目名称:tm,代码行数:8,代码来源:CustomForm.php

示例5: __construct

 public function __construct($scenario = '')
 {
     $this->options = Option::model()->findAll();
     foreach ($this->options as $k => $v) {
         $this->{$v->key} = $v->value;
     }
     parent::__construct($scenario = '');
 }
开发者ID:airycanon,项目名称:go9999_v2,代码行数:8,代码来源:OptionForm.php

示例6: foreach

 /**
  *
  *  Declares attribute labels.
  *
  **/
 function __construct($scenario = 'insert')
 {
     // инициализируем поля
     foreach ($this->attributeLabels() as $key => $value) {
         $this->_attributes[$key] = "";
     }
     parent::__construct($scenario);
 }
开发者ID:Kapodastr,项目名称:grow,代码行数:13,代码来源:Settings.php

示例7: __construct

 public function __construct($scenario = '')
 {
     parent::__construct($scenario);
     for ($i = 2; $i <= self::count; ++$i) {
         $this->_data['title_' . $i] = '';
         $this->_data['value_' . $i] = '';
     }
 }
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:8,代码来源:OptionForm.php

示例8: __construct

 public function __construct($model = null)
 {
     parent::__construct();
     if ($model != null) {
         $this->login = $model->login;
         $this->name = $model->nome;
     }
 }
开发者ID:elikristina,项目名称:portalcegov,代码行数:8,代码来源:NewLoginForm.php

示例9: __construct

 /**
  * Construct the form based on scenario and User model given.
  * @param string $scenario scenario applied
  * @param User $user User model to be initialiazed
  */
 public function __construct($scenario = '', $user = null)
 {
     $this->user = $user;
     if ($this->user) {
         $this->attributes = $this->user->attributes;
         $this->unsetAttributes(['password']);
     }
     parent::__construct($scenario);
 }
开发者ID:andryluthfi,项目名称:annotation-tools,代码行数:14,代码来源:RegisterForm.php

示例10: __construct

 /**
  * Constructor for CiiSettingsModel
  *
  * When this class is initialized, load up the appropriate properties using __get. This ensures that we can reference
  * protected properties inside the class while we're using it (see Themes)
  */
 public function __construct()
 {
     // Protected properties s
     $reflection = new ReflectionClass($this);
     $properties = $reflection->getProperties(ReflectionProperty::IS_PROTECTED);
     foreach ($properties as $property) {
         $this->{$property->name} = $this->__get($property->name);
     }
     return parent::__construct();
 }
开发者ID:fandikurnia,项目名称:CiiMS,代码行数:16,代码来源:CiiSettingsModel.php

示例11: __construct

 public function __construct($scenario = '')
 {
     parent::__construct($scenario);
     for ($i = 2; $i <= self::count; ++$i) {
         $this->_data['cost_value_' . $i] = null;
         $this->_data['cost_currency_id_' . $i] = 1;
         $this->_data['cost_type_id_' . $i] = 4;
         $this->_data['cash_' . $i] = 0;
         $this->_data['nds_include_' . $i] = 0;
     }
 }
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:11,代码来源:CargoCostForm.php

示例12: __construct

 /**
  * Constructor.
  * @param Poll $poll The poll model to export.
  * @param string $scenario Name of the scenario that this model is used in.
  */
 public function __construct($poll, $scenario = '')
 {
     if (get_class($poll) == 'Poll') {
         $this->_poll = $poll;
         $this->_choices = $poll->choices;
         $this->_votes = $poll->votes;
         $this->_totalVotes = $poll->totalVotes;
     } else {
         throw new CException('Invalid Poll object.');
     }
     parent::__construct($scenario);
 }
开发者ID:josemanuel3dx,项目名称:SEMMIO,代码行数:17,代码来源:PollExportForm.php

示例13: __construct

 public function __construct(DaObject $object, $scenario = '')
 {
     parent::__construct($scenario);
     $this->_object = $object;
     foreach ($object->parameters as $parameter) {
         if (in_array($parameter->getType(), self::$_allowedTypes)) {
             $this->_searchParameters[] = new SearchParameter($parameter);
         }
     }
     if (($defaultParam = $object->getParameterObjectByField($object->getFieldCaption())) != null) {
         $this->parameter = $defaultParam->getIdParameter();
     }
 }
开发者ID:kot-ezhva,项目名称:ygin,代码行数:13,代码来源:ParameterSearchForm.php

示例14: __construct

 /**
  * constructor with arguments
  */
 public function __construct($aOrderObj, $encryptedOrderId)
 {
     parent::__construct();
     $this->aOrderObj = $aOrderObj;
     $this->tiffinId = $aOrderObj->order2tiffin;
     $this->quantity = $aOrderObj->num_of_units;
     $this->encryptedOrderId = $encryptedOrderId;
     $this->allowedAPriceTimeObjArray = AppCommon::getAllowedAPriceTimeObjForGivenTiffinAndQuantity($this->tiffinId, $this->quantity);
     if (!isset($this->allowedAPriceTimeObjArray) || count($this->allowedAPriceTimeObjArray) < 1) {
         //redirect to first checkout stage screen for order editing
         Yii::app()->getRequest()->redirect(Yii::app()->getRequest()->getHostInfo() . Yii::app()->getRequest()->getScriptUrl() . '/cart/checkout/id/' . $this->encryptedOrderId);
     }
 }
开发者ID:ankitbishtkec,项目名称:generic-ecommerce-website,代码行数:16,代码来源:TiffinPriceTimeSelectionForm.php

示例15: __construct

 public function __construct($scenario = '')
 {
     parent::__construct($scenario);
     for ($i = 2; $i <= self::count; ++$i) {
         $this->_data['from_' . $i] = '';
         $this->_data['to_' . $i] = '';
         $this->_data['height_' . $i] = '';
         $this->_data['price_' . $i] = '';
         $this->_data['currency_id_' . $i] = '';
         $this->_data['srok_' . $i] = '';
         $this->_data['nds_include_' . $i] = '';
         $this->_data['payment_' . $i] = '';
     }
 }
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:14,代码来源:AreaForm.php


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