private function buildArray(array $fieldProperties = [])
    {
        $baseProperties = [ ];

        if ($this->type !== self::TYPE_OBJECT) {
            $baseProperties['type'] = $this->type;
        } else {
            $baseProperties['properties'] = [];
        }

        if (! $this->indexed) {
            $baseProperties['index'] = 'no';
        } elseif ($this->raw) {
            $baseProperties['index'] = 'not_analyzed';
        }

        if (! $this->enabled) {
            $baseProperties['enabled'] = false;
        }

        return array_replace($baseProperties, $fieldProperties);
    }
private function buildArray(array $fieldProperties = [])
    {
        $baseProperties = [ ];

        if ($this->type !== self::TYPE_OBJECT) {
            $baseProperties['type'] = $this->type;
        } else {
            $baseProperties['properties'] = [];
        }

        if (! $this->indexed) {
            $baseProperties['index'] = 'no';
        } elseif ($this->raw) {
            $baseProperties['index'] = 'not_analyzed';
        }

        if (! $this->enabled) {
            $baseProperties['enabled'] = false;
        }

        return array_replace($baseProperties, $fieldProperties);
    }
private function buildArray ( array $ fieldProperties = [ ] ) { $ baseProperties = [ ] ; if ( $ this -> type !== self :: TYPE_OBJECT ) { $ baseProperties [ 'type' ] = $ this -> type ; } else { $ baseProperties [ 'properties' ] = [ ] ; } if ( ! $ this -> indexed ) { $ baseProperties [ 'index' ] = 'no' ; } elseif ( $ this -> raw ) { $ baseProperties [ 'index' ] = 'not_analyzed' ; } if ( ! $ this -> enabled ) { $ baseProperties [ 'enabled' ] = false ; } return array_replace ( $ baseProperties , $ fieldProperties ) ; }
Helper function to append custom field properties to generic properties array

@param array $fieldProperties
@return array
Helper function to append custom field properties to generic properties array