/** * @param \Agency\Contracts\Cms\Repositories\SectionRepositoryInterface $sections * @param \Agency\Contracts\NewsServiceInterface $news_service * @param \Agency\Contracts\WriterRepositoryInterface $writers * @param \Agency\Contracts\NewsValidatorInterface $news_validator * @param \Agency\Contracts\PhotosServiceInterface $photos_service * @param \Agency\Contracts\ContentServiceInterface $content_service * @param \Agency\Contracts\HelperInterface $helper */ public function __construct(SectionRepositoryInterface $sections, NewsServiceInterface $news_service, WriterRepositoryInterface $writers, NewsValidatorInterface $news_validator, PhotosServiceInterface $photos_service, ContentServiceInterface $content_service, HelperInterface $helper) { parent::__construct(); $this->sections = $sections; $this->news_service = $news_service; $this->writers = $writers; $this->news_validator = $news_validator; $this->photos_service = $photos_service; $this->content_service = $content_service; $this->helper = $helper; $this->section = $this->sections->findBy("alias", self::NEWS_ALIAS); }
/** * check if input exist then prepare the relation object and assign it to the array * * @param $relations * * @return array */ public function sectionRelations($relations) { $result = []; // prepare relations: if (isset($relations['section'])) { $result = ['section' => $this->sections->findBy('alias', $relations['section'])]; } return $result; }