<?php

namespace Lc\SovBundle\Repository\Site;

use Lc\SovBundle\Model\Site\PageInterface;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class PageStore extends AbstractStore implements PageStoreInterface
{
    protected PageRepositoryQueryInterface $query;

    public function __construct(PageRepositoryQueryInterface $query)
    {
        $this->query = $query;
    }

    public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
    {
        $query->orderBy('position');
        return $query;
    }

    public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
    {
        $query->filterIsOnlineAndOffline();
        return $query;
    }

    public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
    {
        return $query;
    }
}
