Beispiel #1
0
 public function saveGenre()
 {
     $this->unlinkAll('genre', true);
     if (isset($this->_genre) && is_array($this->_genre)) {
         foreach ($this->_genre as $genreLabel) {
             $genre = new Genre();
             $genre->label = $genreLabel;
             $genre->link('movie', $this);
         }
     }
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getMusic()
 {
     return $this->hasOne(Genre::className(), ['Id' => 'musicId']);
 }