| Conditions | 3 |
| Paths | 4 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function init() |
||
| 43 | { |
||
| 44 | parent::init(); |
||
| 45 | if (empty($this->attributes)) { |
||
| 46 | $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => [$this->attribute],]; |
||
| 47 | } |
||
| 48 | if ($this->attribute === null) { |
||
| 49 | throw new InvalidConfigException('Either "attribute" property must be specified.'); |
||
| 50 | } |
||
| 51 | $this->snowflake = Instance::ensure($this->snowflake, 'yuncms\base\Snowflake'); |
||
| 52 | } |
||
| 64 | } |