public static function key($key, $array, $returnValue = false)
{
$isExists = array_key_exists((string) $key, (array) $array);
if ($returnValue) {
if ($isExists) {
return $array[$key];
}
return null;
}
return $isExists;
}
/** * Check selected option in list. * * @param array $options * @param string $selectedVal * @return array */ protected function _checkSelected(array $options, $selectedVal) { if (!empty($selectedVal) && !Arr::key($selectedVal, $options)) { $selectedVal = self::KEY_NO_EXITS_VAL; $options = array_merge(array(self::KEY_NO_EXITS_VAL => $this->_translate('No exits')), $options); } return array($options, $selectedVal); }