src/Entity/XiboLayout.php
public function get(array $params = [])
    {
        $this->getLogger()->info('Getting list of layouts ');
        $entries = [];
        $hydratedRegions = [];
        $hydratedWidgets = [];
        $response = $this->doGet($this->url, $params);
        if (isset($params['embed']))
            $embed = ($params['embed'] != null) ? explode(',', $params['embed']) : [];

        foreach ($response as $item) {
            /** @var XiboLayout $layout */
            $layout = new XiboLayout($this->getEntityProvider());
            $layout->hydrate($item);
            foreach ($layout->regions as $reg) {
                /** @var XiboRegion $region */
                $region = new XiboRegion($this->getEntityProvider());
                $region->hydrate($reg);
                if (in_array('playlists', $embed) === true) {
                    /** @var XiboPlaylist $playlist */
                    $playlist = new XiboPlaylist($this->getEntityProvider());
                    $playlist->hydrate($reg['regionPlaylist']);
                    foreach ($playlist->widgets as $widget) {
                        /** @var XiboWidget $widgetObject */
                        $widgetObject = new XiboWidget($this->getEntityProvider());
                        $widgetObject->hydrate($widget);
                        $hydratedWidgets[] = $widgetObject;
                    }
                    $playlist->widgets = $hydratedWidgets;
                    $region->regionPlaylist = $playlist;
                }
                // Add to parent object
                $hydratedRegions[] = $region;
            }
            $layout->regions = $hydratedRegions;

            $entries[] = clone $layout;
        }

        return $entries;
    }
public function get(array $params = [])
    {
        $this->getLogger()->info('Getting list of layouts ');
        $entries = [];
        $hydratedRegions = [];
        $hydratedWidgets = [];
        $response = $this->doGet($this->url, $params);
        if (isset($params['embed']))
            $embed = ($params['embed'] != null) ? explode(',', $params['embed']) : [];

        foreach ($response as $item) {
            /** @var XiboLayout $layout */
            $layout = new XiboLayout($this->getEntityProvider());
            $layout->hydrate($item);
            foreach ($layout->regions as $reg) {
                /** @var XiboRegion $region */
                $region = new XiboRegion($this->getEntityProvider());
                $region->hydrate($reg);
                if (in_array('playlists', $embed) === true) {
                    /** @var XiboPlaylist $playlist */
                    $playlist = new XiboPlaylist($this->getEntityProvider());
                    $playlist->hydrate($reg['regionPlaylist']);
                    foreach ($playlist->widgets as $widget) {
                        /** @var XiboWidget $widgetObject */
                        $widgetObject = new XiboWidget($this->getEntityProvider());
                        $widgetObject->hydrate($widget);
                        $hydratedWidgets[] = $widgetObject;
                    }
                    $playlist->widgets = $hydratedWidgets;
                    $region->regionPlaylist = $playlist;
                }
                // Add to parent object
                $hydratedRegions[] = $region;
            }
            $layout->regions = $hydratedRegions;

            $entries[] = clone $layout;
        }

        return $entries;
    }
public function get ( array $ params = [ ] ) { $ this -> getLogger ( ) -> info ( 'Getting list of layouts ' ) ; $ entries = [ ] ; $ hydratedRegions = [ ] ; $ hydratedWidgets = [ ] ; $ response = $ this -> doGet ( $ this -> url , $ params ) ; if ( isset ( $ params [ 'embed' ] ) ) $ embed = ( $ params [ 'embed' ] != null ) ? explode ( ',' , $ params [ 'embed' ] ) : [ ] ; foreach ( $ response as $ item ) { /** @var XiboLayout $layout */ $ layout = new XiboLayout ( $ this -> getEntityProvider ( ) ) ; $ layout -> hydrate ( $ item ) ; foreach ( $ layout -> regions as $ reg ) { /** @var XiboRegion $region */ $ region = new XiboRegion ( $ this -> getEntityProvider ( ) ) ; $ region -> hydrate ( $ reg ) ; if ( in_array ( 'playlists' , $ embed ) === true ) { /** @var XiboPlaylist $playlist */ $ playlist = new XiboPlaylist ( $ this -> getEntityProvider ( ) ) ; $ playlist -> hydrate ( $ reg [ 'regionPlaylist' ] ) ; foreach ( $ playlist -> widgets as $ widget ) { /** @var XiboWidget $widgetObject */ $ widgetObject = new XiboWidget ( $ this -> getEntityProvider ( ) ) ; $ widgetObject -> hydrate ( $ widget ) ; $ hydratedWidgets [ ] = $ widgetObject ; } $ playlist -> widgets = $ hydratedWidgets ; $ region -> regionPlaylist = $ playlist ; } // Add to parent object $ hydratedRegions [ ] = $ region ; } $ layout -> regions = $ hydratedRegions ; $ entries [ ] = clone $ layout ; } return $ entries ; }
Get an array of layouts.

@param array $params can be filtered by: layoutId, layout, userId, retired, tags, exactTags, ownerUserGroupId and embeddable parameter embed=regions, playlists, widgets, tags
@return array|XiboLayout
Get an array of layouts .