Exemplo n.º 1
0
 /**
  * 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]);
     }
 }
Exemplo n.º 2
0
 /**
  * getAllTypes
  * @return self
  */
 public function getAllTypes()
 {
     return \Application\MusicTypes\Table::select()->execute();
 }
Exemplo n.º 3
0
 public static function getAlltypes()
 {
     $alltypes = Table::getInstance()->getAllTypes();
     return $alltypes;
 }
Exemplo n.º 4
0
<?php

/**
 * Created by PhpStorm.
 * User: gunko
 * Date: 9/29/15
 * Time: 10:22 AM
 */
/**
 * @namespace
 */
namespace Application;

use Bluz\Controller;
use Bluz\Proxy\Request;
return function () {
    $str = Request::getParam('query');
    if ($str != NULL) {
        return $search = \Application\MusicTypes\Table::getInstance()->search($str);
    } else {
        return [];
    }
};