title = $title; $page->slug = $slug; $page->content = $content; $page->meta = $meta; return $page; } public function edit($title, $slug, $content, Meta $meta): void { $this->title = $title; $this->slug = $slug; $this->content = $content; $this->meta = $meta; } public function getSeoTitle(): string { return $this->meta->title ?: $this->title; } public static function tableName(): string { return '{{%pages}}'; } public function behaviors(): array { return [ MetaBehavior::className(), NestedSetsBehavior::className(), ]; } public function transactions(): array { return [ self::SCENARIO_DEFAULT => self::OP_ALL, ]; } public function attributeLabels() { return [ 'title' => Yii::t('page', 'Title'), 'slug' => Yii::t('page', 'Slug'), 'id' => Yii::t('page', 'ID'), 'content' => Yii::t('page', 'Content'), ]; } }