src/Search/Framework/Schema.php
public function build(array $options)
    {
        if (isset($options['fields'])) {
            if (!is_array($options['fields'])) {
                $message = 'Argument 1 passed to ' . __METHOD__ . ' must be an array.';
                throw new \InvalidArgumentException($message);
            }
            foreach ($options['fields'] as $id => $field_options) {
                $this->attachField(new SchemaField($id, $field_options));
            }
        }

        if (isset($options['unique_field'])) {
            $this->setUniqueField($options['unique_field']);
        }
    }
public function build(array $options)
    {
        if (isset($options['fields'])) {
            if (!is_array($options['fields'])) {
                $message = 'Argument 1 passed to ' . __METHOD__ . ' must be an array.';
                throw new \InvalidArgumentException($message);
            }
            foreach ($options['fields'] as $id => $field_options) {
                $this->attachField(new SchemaField($id, $field_options));
            }
        }

        if (isset($options['unique_field'])) {
            $this->setUniqueField($options['unique_field']);
        }
    }
public function build ( array $ options ) { if ( isset ( $ options [ 'fields' ] ) ) { if ( ! is_array ( $ options [ 'fields' ] ) ) { $ message = 'Argument 1 passed to ' . __METHOD__ . ' must be an array.' ; throw new \ InvalidArgumentException ( $ message ) ; } foreach ( $ options [ 'fields' ] as $ id => $ field_options ) { $ this -> attachField ( new SchemaField ( $ id , $ field_options ) ) ; } } if ( isset ( $ options [ 'unique_field' ] ) ) { $ this -> setUniqueField ( $ options [ 'unique_field' ] ) ; } }
Builds the schema from an array of options.

@param array $options
The raw options parsed form the configuration file related to the
schema.

@throws \InvalidArgumentException
Builds the schema from an array of options .