Youshido\GraphQL\Field\AbstractField::__construct PHP Method

__construct() public method

public __construct ( array $config = [] )
$config array
    public function __construct(array $config = [])
    {
        if (empty($config['type'])) {
            $config['type'] = $this->getType();
            $config['name'] = $this->getName();
            if (empty($config['name'])) {
                $config['name'] = $this->getAutoName();
            }
        }
        if (TypeService::isScalarType($config['type'])) {
            $config['type'] = TypeFactory::getScalarType($config['type']);
        }
        $this->nameCache = isset($config['name']) ? $config['name'] : $this->getAutoName();
        $this->config = new FieldConfig($config, $this, $this->isFinal);
        $this->build($this->config);
    }

Usage Example

Beispiel #1
0
 public function __construct(FetcherInterface $fetcher)
 {
     $this->fetcher = $fetcher;
     $this->type = (new NodeInterfaceType())->setFetcher($this->fetcher);
     parent::__construct([]);
 }
All Usage Examples Of Youshido\GraphQL\Field\AbstractField::__construct