Example #1
0
 /**
  * @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;
 }
Example #2
0
 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;
         }
     }
 }
Example #3
0
 public static function getFields()
 {
     return array_merge(parent::getFields(), array('fanart', 'thumbnail'));
 }