示例#1
0
文件: Table.php 项目: Kit-kat1/bluz
 /**
  * updateTypes
  *
  * @return void
  */
 public function updateTypes($data, $id)
 {
     $this::delete(['musician_id' => $id['id']]);
     $data = explode(',', $data);
     foreach ($data as &$type) {
         $type = trim($type);
     }
     $types = \Application\MusicTypes\Table::select()->where('type IN (?)', $data)->execute();
     foreach ($types as $type) {
         $this::insert(['musician_id' => $id['id'], 'type_id' => $type->id]);
     }
 }
示例#2
0
文件: Row.php 项目: Kit-kat1/bluz
 /**
  * getAllTypes
  * @return self
  */
 public function getAllTypes()
 {
     return \Application\MusicTypes\Table::select()->execute();
 }