public function getConfigurator(string $name): DatagridConfiguratorInterface
    {
        if (!isset($this->configurators[$name])) {
            $configurator = null;

            if (isset($this->lazyConfigurators[$name])) {
                $configurator = $this->lazyConfigurators[$name]();
            }

            if (!$configurator) {
                // Support fully-qualified class names.
                if (!class_exists($name) || !in_array(DatagridConfiguratorInterface::class, class_implements($name), true)) {
                    throw new InvalidArgumentException(sprintf('Could not load datagrid configurator "%s"', $name));
                }

                $configurator = new $name();
            }

            $this->configurators[$name] = $configurator;
        }

        return $this->configurators[$name];
    }
public function getConfigurator(string $name): DatagridConfiguratorInterface
    {
        if (!isset($this->configurators[$name])) {
            $configurator = null;

            if (isset($this->lazyConfigurators[$name])) {
                $configurator = $this->lazyConfigurators[$name]();
            }

            if (!$configurator) {
                // Support fully-qualified class names.
                if (!class_exists($name) || !in_array(DatagridConfiguratorInterface::class, class_implements($name), true)) {
                    throw new InvalidArgumentException(sprintf('Could not load datagrid configurator "%s"', $name));
                }

                $configurator = new $name();
            }

            $this->configurators[$name] = $configurator;
        }

        return $this->configurators[$name];
    }
public function getConfigurator ( string $ name ) : DatagridConfiguratorInterface { if ( ! isset ( $ this -> configurators [ $ name ] ) ) { $ configurator = null ; if ( isset ( $ this -> lazyConfigurators [ $ name ] ) ) { $ configurator = $ this -> lazyConfigurators [ $ name ] ( ) ; } if ( ! $ configurator ) { // Support fully-qualified class names. if ( ! class_exists ( $ name ) || ! in_array ( DatagridConfiguratorInterface :: class , class_implements ( $ name ) , true ) ) { throw new InvalidArgumentException ( sprintf ( 'Could not load datagrid configurator "%s"' , $ name ) ) ; } $ configurator = new $ name ( ) ; } $ this -> configurators [ $ name ] = $ configurator ; } return $ this -> configurators [ $ name ] ; }
Returns a DatagridConfigurator by name.

@param string $name The name of the datagrid configurator

@throws InvalidArgumentException if the configurator can not be retrieved

@return DatagridConfiguratorInterface
Returns a DatagridConfigurator by name .