예제 #1
0
파일: Movie.php 프로젝트: syungkeaw/m
 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);
         }
     }
 }
예제 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getMusic()
 {
     return $this->hasOne(Genre::className(), ['Id' => 'musicId']);
 }