/** * @inheritdoc */ public function init() { parent::init(); if ($this->className() == Album::className()) { $this->visible = 1; } }
public function getAlbum() { return $this->hasOne(Album::className(), ['id' => 'album_id']); }
/** * @return \yii\db\ActiveQuery */ public function getAlbums() { return $this->hasMany(Album::className(), ['category_id' => 'id']); }