/** * @param string $location * * @return URLInterface */ public function findByLocation($location) { return $this->model->where('location', '=', URLHelper::sanitise($location))->first(); }
/** * Returns the primary URL for the given page. * * @param PageInterface $page * * @return URLInterface */ public function page(PageInterface $page) { return $this->model->where(Model::ATTR_PAGE_ID, '=', $page->getId())->where(Model::ATTR_IS_PRIMARY, '=', true)->first(); }