src/Entities/FieldCollection.php
public static function initField($configuration = [])
    {
        if (!array_key_exists('type', $configuration) || !class_exists($configuration['type'])) {
            throw new InvalidFieldTypeException('You did not specify a type on this class.');
        }

        $collection = new static();
        $collection->configuration = $configuration;
        $collection->type = $configuration['type'];

        if (array_key_exists('max_items', $configuration)) {
            $collection->maxItems = $configuration['max_items'];
        }

        return $collection;
    }
public static function initField($configuration = [])
    {
        if (!array_key_exists('type', $configuration) || !class_exists($configuration['type'])) {
            throw new InvalidFieldTypeException('You did not specify a type on this class.');
        }

        $collection = new static();
        $collection->configuration = $configuration;
        $collection->type = $configuration['type'];

        if (array_key_exists('max_items', $configuration)) {
            $collection->maxItems = $configuration['max_items'];
        }

        return $collection;
    }
public static function initField ( $ configuration = [ ] ) { if ( ! array_key_exists ( 'type' , $ configuration ) || ! class_exists ( $ configuration [ 'type' ] ) ) { throw new InvalidFieldTypeException ( 'You did not specify a type on this class.' ) ; } $ collection = new static ( ) ; $ collection -> configuration = $ configuration ; $ collection -> type = $ configuration [ 'type' ] ; if ( array_key_exists ( 'max_items' , $ configuration ) ) { $ collection -> maxItems = $ configuration [ 'max_items' ] ; } return $ collection ; }
Initialize a collection with the configuration

@param array $configuration
@throws InvalidFieldTypeException
@return static
Initialize a collection with the configuration