public function getNextTo(PageInterface $page, $direction) { $params = $this->params; if (isset($params['parent'])) { unset($params['parent']); } $params['parentid'] = $page->getParentId(); $params['nextto'] = [$page, $direction]; $finder = $this->addFilters(new Finder\Finder(), $params); return $finder->find(); }
public function lookupPagePermission(Person $person, $role, Page $page) { // Page permissions are prefixed with p_ so add the prefix if it's not present. if (substr($role, 0, 2) !== 'p_') { $role = 'p_' . $role; } do { $result = $this->doLookup($person, $role, $page->getId()); if ($page->getParentId() === null) { break; } if ($result === null) { $page = $page->getParent(); } } while ($result === null && $page !== null); return (bool) $result; }
/** * @param PageInterface $parent * * @return $this */ public function setParent(PageInterface $parent) { if (!$parent->is($this) && $parent->getParentId() !== $this->getId()) { $this->{self::ATTR_PARENT} = $parent->getId(); } return $this; }