/** * Returns defined parameters. * * @param string $key The parameter to be return, if NULL, all parameters are returned * * @return mixed the parameter value or NULL if unfound */ public function getParam($key) { return null !== $this->getDraft() ? $this->getDraft()->getParam($key) : parent::getParam($key); }
/** * Returns the icon URL from the parameter value. * * @param AbstractContent $content The content. * @param string $paramName The parameter name. * * @return string|null The icon URL. */ private function iconizeByParam(AbstractContent $content, $paramName) { if (null === ($parameter = $content->getParam($paramName))) { return null; } if (empty($parameter['value'])) { return null; } return $this->getUri($parameter['value']); }
/** * Returns defined parameters. * * @param string $key The parameter to be return, if NULL, all parameters are returned * * @return mixed the parameter value or NULL if unfound */ public function getParam($key) { if (!isset($this->defaultParams[$key])) { return; } $value = null !== $this->getDraft() ? $this->getDraft()->getParam($key) : parent::getParam($key); $params = $this->defaultParams[$key]; if ($value !== null) { $params['value'] = $value['value']; } return $params; }