MetaModels\Filter\Setting\CustomSql::getValueFromServiceContainer PHP Method

getValueFromServiceContainer() private method

Retrieve the value with the given name from the service container.
private getValueFromServiceContainer ( string $valueName, array $arguments ) : mixed
$valueName string The name of the value in the source to retrieve.
$arguments array The arguments of the parameter.
return mixed
    private function getValueFromServiceContainer($valueName, $arguments)
    {
        if (!empty($arguments['service'])) {
            $serviceName = $arguments['service'];
        } else {
            $serviceName = $valueName;
        }
        $service = $this->getServiceContainer()->getService($serviceName);
        if (is_callable($service)) {
            return call_user_func($service, $valueName, $arguments);
        }
        return 'NULL';
    }