src/Entity/XiboPlaylist.php
public function add($name, $tags= '', $isDynamic = 0, $filterMediaName = '', $filterMediaTags = '')
    {
        $hydratedWidgets = [];
        $this->name = $name;
        $this->tags = $tags;
        $this->isDynamic = $isDynamic;
        $this->filterMediaName = $filterMediaName;
        $this->filterMediaTags = $filterMediaTags;

        $this->getLogger()->info('Creating Playlist ' . $this->name);
        $response = $this->doPost('/playlist', $this->toArray());

        /** @var XiboPlaylist $playlist */
        $playlist = new XiboPlaylist($this->getEntityProvider());
        $playlist->hydrate($response);
        if (isset($playlist->widgets)) {
            foreach ($playlist->widgets as $widget) {
                /** @var XiboWidget $widgetObject */
                $widgetObject = new XiboWidget($this->getEntityProvider());
                $widgetObject->hydrate($widget);
                $hydratedWidgets[] = $widgetObject;
            }
            $playlist->widgets = $hydratedWidgets;
        }

        return $playlist;
    }
public function add($name, $tags= '', $isDynamic = 0, $filterMediaName = '', $filterMediaTags = '')
    {
        $hydratedWidgets = [];
        $this->name = $name;
        $this->tags = $tags;
        $this->isDynamic = $isDynamic;
        $this->filterMediaName = $filterMediaName;
        $this->filterMediaTags = $filterMediaTags;

        $this->getLogger()->info('Creating Playlist ' . $this->name);
        $response = $this->doPost('/playlist', $this->toArray());

        /** @var XiboPlaylist $playlist */
        $playlist = new XiboPlaylist($this->getEntityProvider());
        $playlist->hydrate($response);
        if (isset($playlist->widgets)) {
            foreach ($playlist->widgets as $widget) {
                /** @var XiboWidget $widgetObject */
                $widgetObject = new XiboWidget($this->getEntityProvider());
                $widgetObject->hydrate($widget);
                $hydratedWidgets[] = $widgetObject;
            }
            $playlist->widgets = $hydratedWidgets;
        }

        return $playlist;
    }
public function add ( $ name , $ tags = '' , $ isDynamic = 0 , $ filterMediaName = '' , $ filterMediaTags = '' ) { $ hydratedWidgets = [ ] ; $ this -> name = $ name ; $ this -> tags = $ tags ; $ this -> isDynamic = $ isDynamic ; $ this -> filterMediaName = $ filterMediaName ; $ this -> filterMediaTags = $ filterMediaTags ; $ this -> getLogger ( ) -> info ( 'Creating Playlist ' . $ this -> name ) ; $ response = $ this -> doPost ( '/playlist' , $ this -> toArray ( ) ) ; /** @var XiboPlaylist $playlist */ $ playlist = new XiboPlaylist ( $ this -> getEntityProvider ( ) ) ; $ playlist -> hydrate ( $ response ) ; if ( isset ( $ playlist -> widgets ) ) { foreach ( $ playlist -> widgets as $ widget ) { /** @var XiboWidget $widgetObject */ $ widgetObject = new XiboWidget ( $ this -> getEntityProvider ( ) ) ; $ widgetObject -> hydrate ( $ widget ) ; $ hydratedWidgets [ ] = $ widgetObject ; } $ playlist -> widgets = $ hydratedWidgets ; } return $ playlist ; }
Create a new Playlist

@param string $name Name of the playlist
@param string $tags A Comma separated list of tags
@param int $isDynamic Flag indicating whether the playlist is dynamic
@param string $filterMediaName For dynamic playlist the filter by media Name
@param string $filterMediaTags For dynamic playlist the filter by media Tag
@return XiboPlaylist
Create a new Playlist