/** * @param null $path * @param null $default * @return $this|null */ public function get($path = null, $default = null) { if (is_null($path)) { return $this; } $pathKey = implode('|', (array) $path); if (!isset($this->childConfig[$pathKey])) { if (!ArrayUtils::issetByPath($this->configRaw, $path)) { return is_array($default) ? new Config([]) : $default; } $needConfig = ArrayUtils::getByPath($this->configRaw, $path, $default); if (is_array($needConfig)) { $this->childConfig[$pathKey] = new Config($needConfig); } else { $this->childConfig[$pathKey] = $needConfig; } } return $this->childConfig[$pathKey]; }
public function getFieldFilter($field, $filter) { $fieldMeta = $this->getFieldMeta($field); if (!$fieldMeta) { return null; } return ArrayUtils::getByPath($fieldMeta, ["filters", $filter]); }