private function getChannelIdsInclusiveSubChannels($channelIds)
    {
        $subChannelIds = [];

        foreach ($channelIds as $channelId) {
            $subChannels = $this->getChannelList()->getChildren($channelId);
            $subChannelIds = array_merge($subChannelIds, $subChannels->map(function (Channel $channel) {
                return $channel->getId();
            })->toArray());
        }

        return empty($subChannelIds)
            ? $channelIds
            : array_merge($channelIds, $this->getChannelIdsInclusiveSubChannels($subChannelIds));
    }
private function getChannelIdsInclusiveSubChannels($channelIds)
    {
        $subChannelIds = [];

        foreach ($channelIds as $channelId) {
            $subChannels = $this->getChannelList()->getChildren($channelId);
            $subChannelIds = array_merge($subChannelIds, $subChannels->map(function (Channel $channel) {
                return $channel->getId();
            })->toArray());
        }

        return empty($subChannelIds)
            ? $channelIds
            : array_merge($channelIds, $this->getChannelIdsInclusiveSubChannels($subChannelIds));
    }
private function getChannelIdsInclusiveSubChannels ( $ channelIds ) { $ subChannelIds = [ ] ; foreach ( $ channelIds as $ channelId ) { $ subChannels = $ this -> getChannelList ( ) -> getChildren ( $ channelId ) ; $ subChannelIds = array_merge ( $ subChannelIds , $ subChannels -> map ( function ( Channel $ channel ) { return $ channel -> getId ( ) ; } ) -> toArray ( ) ) ; } return empty ( $ subChannelIds ) ? $ channelIds : array_merge ( $ channelIds , $ this -> getChannelIdsInclusiveSubChannels ( $ subChannelIds ) ) ; }
Returns an array containing all channel IDs inclusive sub channels.

@param $channelIds

@return array
Returns an array containing all channel IDs inclusive sub channels .