/** * @param \ride\application\orm\entry\SecuredPathEntry $securedPath * @return null */ public function setSecuredPath(SecuredPathEntry $securedPath = NULL) { if (!isset($this->loadedFields['securedPath'])) { $this->loadProperties(); } $oldValue = null; if (array_key_exists('securedPath', $this->loadedValues)) { $oldValue = $this->loadedValues['securedPath']; } if (!$oldValue && !$securedPath || $oldValue && $securedPath && $oldValue->getId() === $securedPath->getId()) { $this->securedPath = $securedPath; return; } return parent::setSecuredPath($securedPath); }
/** * @param \ride\application\orm\entry\SecuredPathEntry $securedPath * @return null */ public function setSecuredPath(AliasSecuredPathEntry $securedPath = NULL) { $isClean = false; if (!$this->securedPath && !$securedPath || $this->securedPath && $securedPath && $this->securedPath->getId() === $securedPath->getId()) { $isClean = true; } $this->securedPath = $securedPath; if (!$isClean && $this->entryState === self::STATE_CLEAN) { $this->entryState = self::STATE_DIRTY; } }
/** * @param \ride\application\orm\entry\SecuredPathEntry $entry * @return null */ public function removeFromRolePaths(AliasSecuredPathEntry $entry) { $this->getRolePaths(); $status = false; foreach ($this->rolePaths as $rolePathsIndex => $rolePathsValue) { if ($rolePathsValue === $entry || $rolePathsValue->getId() === $entry->getId()) { unset($this->rolePaths[$rolePathsIndex]); $status = true; break; } } if ($status && $this->entryState === self::STATE_CLEAN) { $this->entryState = self::STATE_DIRTY; } return $status; }