255], [['default_currency'], 'string', 'max' => 8], [['contentcontainer_id'], 'unique'], ]; } public function beforeSave($insert) { if (!parent::beforeSave($insert)) { return false; } $now = date('Y-m-d H:i:s'); if ($insert && empty($this->created_at)) { $this->created_at = $now; } $this->updated_at = $now; if (empty($this->default_currency)) { $this->default_currency = 'USD'; } return true; } }