/** * @param string $location * @param int $pageId * @param bool $isPrimary * * @return URLInterface */ public function create($location, $pageId, $isPrimary = false) { $unique = URLHelper::makeUnique(URLHelper::sanitise($location)); return $this->model->create(['location' => $unique, 'page_id' => $pageId, 'is_primary' => $isPrimary]); }
/** * @param string $location * @param PageInterface $page * @param bool $isPrimary * * @return URLInterface */ public function create($location, PageInterface $page, $isPrimary = false) { $unique = URLHelper::makeUnique(URLHelper::sanitise($location)); return $this->model->create([Model::ATTR_LOCATION => $unique, Model::ATTR_PAGE_ID => $page->getId(), Model::ATTR_IS_PRIMARY => $isPrimary]); }