Ejemplo n.º 1
0
 /**
  *
  * @param int $songId
  * @param string|int $interpret name or ID
  * @return \Nette\Database\Table\ActiveRow|false
  */
 public function assignInterpret($songId, $interpret)
 {
     if (is_string($interpret)) {
         $ri = $this->interpreti->getByName($interpret);
         if ($ri) {
             return $this->setInterpret($songId, $ri->id);
         }
         return false;
     } elseif (is_integer($interpret)) {
         return $this->setInterpret($songId, $interpret);
     }
     throw new \Nette\InvalidArgumentException(603, "Interpret must be name (string) or ID (integer)");
 }