_request = $request; } /** * Setting flag value * * @param string $action * @param string $flag * @param string $value * @return void */ public function set($action, $flag, $value) { if ('' === $action) { $action = $this->_request->getActionName(); } $this->_flags[$this->_getControllerKey()][$action][$flag] = $value; } /** * Retrieve flag value * * @param string $action * @param string $flag * @return bool * * @SuppressWarnings(PHPMD.BooleanGetMethodName) */ public function get($action, $flag = '') { if ('' === $action) { $action = $this->_request->getActionName(); } if ('' === $flag) { return $this->_flags[$this->_getControllerKey()] ?? []; } elseif (isset($this->_flags[$this->_getControllerKey()][$action][$flag])) { return $this->_flags[$this->_getControllerKey()][$action][$flag]; } else { return false; } } /** * Get controller key * * @return string */ protected function _getControllerKey() { return $this->_request->getRouteName() . '_' . $this->_request->getControllerName(); } }