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


PHP ActiveRecord::init方法代码示例

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


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

示例1: init

 /**
  * Init function
  * @defaultParam sort = 500
  */
 public function init()
 {
     if (empty($this->sort)) {
         $this->sort = 500;
     }
     parent::init();
 }
开发者ID:ArtTum,项目名称:yii2-portfolio-landing,代码行数:11,代码来源:Skills.php

示例2: init

 public function init()
 {
     $this->created_at = time();
     $this->is_blocked = false;
     $this->parent_id = NULL;
     return parent::init();
 }
开发者ID:jarrus90,项目名称:yii2-website-comments,代码行数:7,代码来源:Comment.php

示例3: init

 public function init()
 {
     parent::init();
     $this->typeList = [self::PAY_IN => 'Пополнение счета', self::PAY_OUT => 'Выплата'];
     $this->statusList = [self::STATUS_PENDING => 'На рассмотрении магазина', self::STATUS_FAIL => 'Не оплачен', self::STATUS_SUCCESS => 'Оплачен'];
     $this->status = self::STATUS_SUCCESS;
 }
开发者ID:nicdnepr,项目名称:skidos,代码行数:7,代码来源:Paylog.php

示例4: init

 public function init()
 {
     parent::init();
     if (isset(Yii::$app->user) && Yii::$app->user instanceof WebUser && !Yii::$app->user->getIsGuest() && static::ADMIN == Yii::$app->user->identity->status) {
         $this->scenario = 'admin';
     }
 }
开发者ID:kissarat,项目名称:tornados.su,代码行数:7,代码来源:User.php

示例5: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->active = true;
     $this->height = 300;
     $this->imageCount = 0;
 }
开发者ID:simple-yii2,项目名称:slider,代码行数:10,代码来源:Slider.php

示例6: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->on(self::EVENT_BEFORE_INSERT, function (\yii\base\ModelEvent $Event) {
         $Event->sender->date_create = new \yii\db\Expression('NOW()');
     });
 }
开发者ID:komponen,项目名称:yii2-postman,代码行数:10,代码来源:LetterModel.php

示例7: init

 public function init()
 {
     //		if (!is_dir($this->previewUploadPath())){
     //			FileHelper::createDirectory($this->previewUploadPath(),0777);
     //		}
     parent::init();
 }
开发者ID:dub34,项目名称:books-test,代码行数:7,代码来源:Book.php

示例8: init

 /** @inheritdoc */
 public function init()
 {
     $this->finder = \Yii::$container->get(Finder::className());
     $this->mailer = \Yii::$container->get(Mailer::className());
     $this->module = \Yii::$app->getModule('user');
     parent::init();
 }
开发者ID:chd7well,项目名称:yii2-user,代码行数:8,代码来源:User.php

示例9: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!$this->type) {
         $this->type = static::TYPE;
     }
 }
开发者ID:manyoubaby123,项目名称:imshop,代码行数:10,代码来源:Page.php

示例10: init

 public function init()
 {
     parent::init();
     $this->_modelFields = array_keys(self::getAttributes());
     self::getConfig();
     XiiHeader::run(self::$_whoAmI);
 }
开发者ID:keigonec,项目名称:XiiBackend,代码行数:7,代码来源:XiiArPlus.php

示例11: init

 public function init()
 {
     if (!$this->userClass) {
         $this->userClass = Yii::$app->modules[Module::MODULE_ID]->userClass;
     }
     return parent::init();
 }
开发者ID:gbksoft,项目名称:yii2-tokens,代码行数:7,代码来源:UserToken.php

示例12: init

 public function init()
 {
     if ($this->hasAttribute('sort_num')) {
         $this->sort_num = Constants::getSortNum();
     }
     parent::init();
 }
开发者ID:sym660,项目名称:lulucms2,代码行数:7,代码来源:BaseActiveRecord.php

示例13: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if (null === $this->uid) {
         $this->uid = self::generateUID();
     }
     parent::init();
 }
开发者ID:icalab,项目名称:yii2-ica-mediafile,代码行数:10,代码来源:Mediafile.php

示例14: init

 public function init()
 {
     // create weights
     $key = 0;
     foreach ($this->getRuleAllIdName() as $id => $name) {
         $this->weights[$key] = $key;
         $key++;
     }
     $this->weights[$key] = $key;
     $modelRuleCondition = new RuleCondition();
     /*echo('<pre>');
     		print_r($modelRuleCondition->conditions);
     		print_r($modelRuleCondition->weights);
     		echo('</pre>');
     		exit();*/
     $this->RuleCondition_conditions = $modelRuleCondition->conditions;
     $this->RuleCondition_equations = $modelRuleCondition->equations;
     $this->RuleCondition_weights = $modelRuleCondition->weights;
     $this->RuleCondition_name = [];
     $this->RuleCondition_condition = [];
     $this->RuleCondition_equation = [];
     $this->RuleCondition_value = [];
     $this->RuleCondition_weight = [];
     parent::init();
 }
开发者ID:hvos234,项目名称:raspberrypi.home.website,代码行数:25,代码来源:Rule_20151030.php

示例15: init

 public function init()
 {
     parent::init();
     $this->on(self::EVENT_AFTER_FIND, [$this, 'decodeTransactionConfig']);
     $this->on(self::EVENT_BEFORE_INSERT, [$this, 'encodeTransactionConfig']);
     $this->on(self::EVENT_BEFORE_UPDATE, [$this, 'encodeTransactionConfig']);
 }
开发者ID:luyadev,项目名称:luya-module-payment,代码行数:7,代码来源:DataPaymentProcessModel.php


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