src/Entity/XiboPlaylist.php
public function assign($media, $duration, $playlistId)
    {
        $this->playlistId = $playlistId;
        $this->media = $media;
        $this->getLogger()->info('Assigning Media To Playlist ' . $this->playlistId);
        $response = $this->doPost('/playlist/library/assign/' . $playlistId, [
        	'media' => $media,
            'duration' => $duration
        	]);

        // Parse response
        //  set properties
        $this->playlistId = $response['playlistId'];

        $this->getLogger()->debug('Creating child object Widgets and linking it to parent Playlist');
        // Set widgets property (with XiboWidget objects)
        foreach ($response['widgets'] as $widget) {
            $this->widgets[] = (new XiboWidget($this->getEntityProvider()))->hydrate($widget);
        }

        return $this;
    }
public function assign($media, $duration, $playlistId)
    {
        $this->playlistId = $playlistId;
        $this->media = $media;
        $this->getLogger()->info('Assigning Media To Playlist ' . $this->playlistId);
        $response = $this->doPost('/playlist/library/assign/' . $playlistId, [
        	'media' => $media,
            'duration' => $duration
        	]);

        // Parse response
        //  set properties
        $this->playlistId = $response['playlistId'];

        $this->getLogger()->debug('Creating child object Widgets and linking it to parent Playlist');
        // Set widgets property (with XiboWidget objects)
        foreach ($response['widgets'] as $widget) {
            $this->widgets[] = (new XiboWidget($this->getEntityProvider()))->hydrate($widget);
        }

        return $this;
    }
public function assign ( $ media , $ duration , $ playlistId ) { $ this -> playlistId = $ playlistId ; $ this -> media = $ media ; $ this -> getLogger ( ) -> info ( 'Assigning Media To Playlist ' . $ this -> playlistId ) ; $ response = $ this -> doPost ( '/playlist/library/assign/' . $ playlistId , [ 'media' => $ media , 'duration' => $ duration ] ) ; // Parse response //  set properties $ this -> playlistId = $ response [ 'playlistId' ] ; $ this -> getLogger ( ) -> debug ( 'Creating child object Widgets and linking it to parent Playlist' ) ; // Set widgets property (with XiboWidget objects) foreach ( $ response [ 'widgets' ] as $ widget ) { $ this -> widgets [ ] = ( new XiboWidget ( $ this -> getEntityProvider ( ) ) ) -> hydrate ( $ widget ) ; } return $ this ; }
Assign media to playlist.

@param array[int] $media Array of Media IDs to assign
@param int $duration Optional duration for all Media in this assignment to use on the widget
@param int $playlistId The Playlist ID to assign to
@return XiboPlaylist
Assign media to playlist .