. * */ namespace Friendica\Content\Conversation\Factory; use Friendica\Content\Conversation\Collection\Timelines; use Friendica\Content\Conversation\Repository\Channel as ChannelRepository; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; use Psr\Log\LoggerInterface; final class UserDefinedChannel extends Timeline { public function __construct(ChannelRepository $channel, L10n $l10n, LoggerInterface $logger, IManageConfigValues $config) { parent::__construct($channel, $l10n, $logger, $config); } /** * List of available user defined channels * * @param integer $uid * @return Timelines */ public function getForUser(int $uid): Timelines { foreach ($this->channel->selectByUid($uid) as $channel) { $tabs[] = $channel; } return new Timelines($tabs); } public function isTimeline(string $selectedTab, int $uid): bool { return is_numeric($selectedTab) && $uid && $this->channel->existsById($selectedTab, $uid); } }