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


PHP ActiveRecord::__construct方法代码示例

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


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

示例1: __construct

 /**
  * @inheritdoc
  */
 public function __construct($config = [])
 {
     // Init pathes
     $this->basePath = Yii::getAlias('@frontend') . '/web/images/store/';
     $this->baseUrl = 'http://' . $_SERVER['HTTP_HOST'] . '/images/store/';
     parent::__construct($config);
 }
开发者ID:alexsynytskiy,项目名称:Dynamomania,代码行数:10,代码来源:Asset.php

示例2: __construct

 public function __construct($config = array())
 {
     $this->key_id = Yii::$app->user->getId();
     $this->ip = Yii::$app->getRequest()->getUserIP();
     $this->query = Yii::$app->getRequest()->getUrl();
     parent::__construct($config);
 }
开发者ID:vadoss,项目名称:hryvna-today,代码行数:7,代码来源:Log.php

示例3: array

 function __construct($config = array(), $type = false)
 {
     if ($type !== false) {
         self::$tabName = $type;
     }
     parent::__construct($config);
 }
开发者ID:A111ex,项目名称:parser.ru,代码行数:7,代码来源:GoodsT.php

示例4: __construct

 /**
  * Counter constructor.
  *
  * @param int $type_id
  * @param array $config
  */
 public function __construct($type_id = -1, $config = [])
 {
     if ($type_id > 0 && array_key_exists($type_id, static::getTypesArray())) {
         $this->type = $type_id;
     }
     parent::__construct($config);
 }
开发者ID:samlx,项目名称:Bulk,代码行数:13,代码来源:Counter.php

示例5: __construct

 public function __construct($login = null, $config = [])
 {
     if (isset($login)) {
         if (static::findByLogin($login)) {
             throw new ErrorException('User with login "' . $login . '" already exists in Payture.');
         }
         $this->login = $login;
         $this->generatePassword();
     }
     parent::__construct($config);
 }
开发者ID:bfday,项目名称:yii2-payture-module,代码行数:11,代码来源:Customer.php

示例6: __construct

 public function __construct($user = null, $scope = null, $config = [])
 {
     parent::__construct($config);
     // If creating new for a user, setup properties.
     if (!empty($user)) {
         $this->user_id = is_int($user) ? $user : $user->id;
         $this->code = $this->generateCode();
         $this->scope = $scope;
     }
     static::maybeGarbageCollect();
 }
开发者ID:singleso,项目名称:singleso,代码行数:11,代码来源:Oauth2Code.php

示例7: __construct

 public function __construct($maximumValidation = true, $config = [])
 {
     if (is_bool($maximumValidation)) {
         $this->maximumValidation = $maximumValidation;
     } else {
         $this->maximumValidation = true;
         $config = $maximumValidation;
         // probably $config passed as first
         // and only parameter
     }
     $this->yiiValidationRulesBuilder = new YiiValidationRulesBuilder($this->maximumValidation, self::tableName());
     if (!isset(self::$ruleList[self::tableName()][$this->maximumValidation])) {
         if ($this->maximumValidation) {
             $this->buildStrictRules();
         } else {
             $this->buildDefaultRules();
         }
     } else {
         // for code coverage analysis
     }
     parent::__construct($config);
 }
开发者ID:vitalyspirin,项目名称:yii2-simpleactiverecord,代码行数:22,代码来源:SimpleActiveRecord.php

示例8: __construct

 public function __construct()
 {
     $this->id = '%%newid%%';
     parent::__construct();
 }
开发者ID:alexshadie,项目名称:wallet,代码行数:5,代码来源:TransactionExpense.php

示例9: __construct

 /**
  * @param array $config - Name-value pairs that will be used to initialize the object properties
  */
 public function __construct($config = [])
 {
     $this->moduleId = isset($config['id']) ? $config['id'] : 'content';
     parent::__construct();
 }
开发者ID:heartshare,项目名称:yii2-content-module,代码行数:8,代码来源:Content.php

示例10: __construct

 public function __construct($config = [])
 {
     $this->attachBehavior('fileManager', require __DIR__ . '/behaviors/user-profile/filemanager.php');
     parent::__construct($config);
 }
开发者ID:rkit,项目名称:bootstrap-yii2,代码行数:5,代码来源:UserProfile.php

示例11: __construct

 public function __construct($config = [])
 {
     parent::__construct($config);
 }
开发者ID:apmauj,项目名称:1f8bf10ab74d6f5ca69f7c07b7ee1c38,代码行数:4,代码来源:OrdenRutaForm.php

示例12: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->on(ActiveRecord::EVENT_BEFORE_INSERT, array($this, 'onSave'));
     $this->on(ActiveRecord::EVENT_BEFORE_UPDATE, array($this, 'onSave'));
 }
开发者ID:andrewSAY,项目名称:LibaryTest,代码行数:6,代码来源:Books.php

示例13: __construct

 public function __construct($config = [])
 {
     $this->_transformers = static::createTransformers();
     parent::__construct($config);
 }
开发者ID:tsyrya,项目名称:mybriop,代码行数:5,代码来源:EntityBase.php

示例14: __construct

 /**
  * Mar constructor.
  * @param array $table
  * @param array $config
  */
 public function __construct($table, $config = [])
 {
     self::$table = $table;
     parent::__construct($config);
 }
开发者ID:VampireMe,项目名称:admin-9939-com,代码行数:10,代码来源:Dynamic.php


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