/** * @param \NajiDev\XbmcApi\Model\Item\Base $entity * @throws \InvalidArgumentException */ public function add(Base $entity) { if (null === ($id = $entity->getId())) { throw new \InvalidArgumentException('Entity has to have an id'); } $class = get_class($entity); if (!array_key_exists($class, $this->map)) { $this->map[$class] = array(); } $this->map[$class][$id] = $entity; }
public function __construct($object = null) { parent::__construct($object); $this->setMovies(array()); if ($object instanceof \stdClass) { $this->id = $object->setid; foreach ($object->items->movies as $movie) { $this->movieIds[] = $movie->movieid; $this->movieNames[] = $movie->label; } } }
public static function getFields() { return array_merge(parent::getFields(), array('fanart', 'thumbnail')); }