protected function initializeField($field, $settings)
    {
        if ($this->isContentField($field) || $this->isRevisionField($field)) {
            throw new ReservedFieldNameException(
                "The field '$field' cannot be used in '" . get_class($this) . "' as it is a reserved name"
            );
        }

        $type = $settings['type'];

        if (!array_key_exists($type, self::$types)) {
            throw new InvalidFieldTypeException("Unkown type '$type' in '" . get_class($this) . "'");
        }

        $settings['type'] = self::$types[$settings['type']];

        return FieldCollection::initField($settings);
    }
protected function initializeField($field, $settings)
    {
        if ($this->isContentField($field) || $this->isRevisionField($field)) {
            throw new ReservedFieldNameException(
                "The field '$field' cannot be used in '" . get_class($this) . "' as it is a reserved name"
            );
        }

        $type = $settings['type'];

        if (!array_key_exists($type, self::$types)) {
            throw new InvalidFieldTypeException("Unkown type '$type' in '" . get_class($this) . "'");
        }

        $settings['type'] = self::$types[$settings['type']];

        return FieldCollection::initField($settings);
    }
protected function initializeField ( $ field , $ settings ) { if ( $ this -> isContentField ( $ field ) || $ this -> isRevisionField ( $ field ) ) { throw new ReservedFieldNameException ( "The field '$field' cannot be used in '" . get_class ( $ this ) . "' as it is a reserved name" ) ; } $ type = $ settings [ 'type' ] ; if ( ! array_key_exists ( $ type , self :: $ types ) ) { throw new InvalidFieldTypeException ( "Unkown type '$type' in '" . get_class ( $ this ) . "'" ) ; } $ settings [ 'type' ] = self :: $ types [ $ settings [ 'type' ] ] ; return FieldCollection :: initField ( $ settings ) ; }
Validate configuration and prepare a FieldCollection

@param string $field
@param array $settings
@throws InvalidFieldTypeException
@throws ReservedFieldNameException
@return FieldCollection
Validate configuration and prepare a FieldCollection