本文整理汇总了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);
}
示例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);
}
示例3: array
function __construct($config = array(), $type = false)
{
if ($type !== false) {
self::$tabName = $type;
}
parent::__construct($config);
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例8: __construct
public function __construct()
{
$this->id = '%%newid%%';
parent::__construct();
}
示例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();
}
示例10: __construct
public function __construct($config = [])
{
$this->attachBehavior('fileManager', require __DIR__ . '/behaviors/user-profile/filemanager.php');
parent::__construct($config);
}
示例11: __construct
public function __construct($config = [])
{
parent::__construct($config);
}
示例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'));
}
示例13: __construct
public function __construct($config = [])
{
$this->_transformers = static::createTransformers();
parent::__construct($config);
}
示例14: __construct
/**
* Mar constructor.
* @param array $table
* @param array $config
*/
public function __construct($table, $config = [])
{
self::$table = $table;
parent::__construct($config);
}