public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => [$this->createdByAttribute, $this->updatedByAttribute], BaseActiveRecord::EVENT_BEFORE_UPDATE => $this->updatedByAttribute]; } }
public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_VALIDATE => $this->phoneAttribute, BaseActiveRecord::EVENT_AFTER_FIND => $this->phoneAttribute]; } }
/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_AFTER_VALIDATE => [$this->attribute], BaseActiveRecord::EVENT_AFTER_FIND => [$this->attribute]]; } }
/** * @inheritdoc */ public function init() { if ($this->attribute !== null) { $this->attributes[BaseActiveRecord::EVENT_BEFORE_INSERT][] = $this->attribute; } parent::init(); }
/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => $this->compiledAttribute, BaseActiveRecord::EVENT_BEFORE_UPDATE => $this->compiledAttribute]; } }
/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => 'date', BaseActiveRecord::EVENT_BEFORE_UPDATE => 'date', BaseActiveRecord::EVENT_AFTER_FIND => 'date']; } }
/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_DELETE => $this->trashAttribute]; } }
/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => [$this->authorAttribute]]; } }
public function init() { parent::init(); if ($this->hashFunction == null) { $this->hashFunction = [$this, 'defaultHashFunction']; } $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => $this->passwordAttribute, BaseActiveRecord::EVENT_BEFORE_UPDATE => $this->passwordAttribute]; $this->value = $this->hashFunction; }
/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_VALIDATE => $this->attribute]; } if ($this->attribute === null) { throw new InvalidConfigException('Either "attribute" or "value" property must be specified.'); } }
/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [$this->trigger => $this->uniqueAttribute]; } if (!empty($this->paramAttributes) && $this->paramOrder === null) { throw new InvalidConfigException('$paramOrder wajib diisi jika $paramAttributes diisi'); } if ($this->length === null) { throw new InvalidConfigException('$length wajib diisi'); } }
/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_AFTER_INSERT => $this->imageAttributes, BaseActiveRecord::EVENT_AFTER_UPDATE => $this->imageAttributes]; foreach ($this->imageAttributes as $attribute => $params) { if (is_numeric($attribute)) { $attribute = $params; $params = []; } $this->descriptors[$attribute] = Yii::createObject($params + ['class' => '\\vr\\image\\ImageAttributeDescriptor', 'attribute' => $attribute]); } } }
public function init() { parent::init(); if (empty($this->attributes)) { foreach ($this->convertAttr as $key => $value) { $attrName = is_scalar($key) ? $key : $value; $convertType = is_scalar($key) ? $value : self::DEFAULT_CONVERT_TYPE; if (!in_array($convertType, $this->allowConvertType)) { throw new \Exception(strtr('Disallow type convert "{type}"', ['{type}' => $convertType])); } $this->attributes[BaseActiveRecord::EVENT_BEFORE_INSERT][] = $attrName; $this->attributes[BaseActiveRecord::EVENT_BEFORE_UPDATE][] = $attrName; $this->attributes[BaseActiveRecord::EVENT_AFTER_FIND][] = $attrName; $this->attributes[BaseActiveRecord::EVENT_AFTER_INSERT][] = $attrName; $this->attributes[BaseActiveRecord::EVENT_AFTER_UPDATE][] = $attrName; } } }
/** * @inheritdoc */ public function init() { parent::init(); if ($this->className == null) { throw new \yii\base\InvalidConfigException("'className' must be set"); } if (!is_array($this->map)) { throw new \yii\base\InvalidConfigException("'map' must be an array; e.g.: ['gid' => 'group_id']"); } else { if (!count($this->map) > 0) { throw new \yii\base\InvalidConfigException("'map' must contain the mapping group => local; e.g.: ['gid' => 'group_id']"); } } if (!Yii::$app instanceof \yii\console\Application) { if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => array_values($this->map)[0]]; } } }
/** * @inheritdoc */ public function init() { parent::init(); $this->category = str_replace(['{', '%', '}'], '', $this->category); }
/** * @inheritdoc */ public function init() { parent::init(); $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => [$this->positionAttribute]]; }
/** * @inheritdoc */ public function init() { parent::init(); $this->attributes = [BaseActiveRecord::EVENT_INIT => $this->attribute]; }
/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => [$this->TitleAttribute, $this->DescriptionAttribute, $this->KeywordsAttribute], BaseActiveRecord::EVENT_BEFORE_UPDATE => [$this->TitleAttribute, $this->DescriptionAttribute, $this->KeywordsAttribute]]; } }