Blueprints/src/BlueprintSchema.php
public function embed($name, array $value, $separator = '.', $merge = false)
    {
        if (isset($value['rules'])) {
            $this->rules = array_merge($this->rules, $value['rules']);
        }

        $name = $separator !== '.' ? str_replace($separator, '.', $name) : $name;

        if (isset($value['form'])) {
            $form = array_diff_key($value['form'], ['fields' => 1, 'field' => 1]);
        } else {
            $form = [];
        }

        $items = isset($this->items[$name]) ? $this->items[$name] : ['type' => '_root', 'form_field' => false];

        $this->items[$name] = $items;
        $this->addProperty($name);

        $prefix = $name ? $name . '.' : '';
        $params = array_intersect_key($form, $this->filter);
        $location = [$name];

        if (isset($value['form']['field'])) {
            $this->parseFormField($name, $value['form']['field'], $params, $prefix, '', $merge, $location);
        } elseif (isset($value['form']['fields'])) {
            $this->parseFormFields($value['form']['fields'], $params, $prefix, '', $merge, $location);
        }

        $this->items[$name] += ['form' => $form];

        return $this;
    }
public function embed($name, array $value, $separator = '.', $merge = false)
    {
        if (isset($value['rules'])) {
            $this->rules = array_merge($this->rules, $value['rules']);
        }

        $name = $separator !== '.' ? str_replace($separator, '.', $name) : $name;

        if (isset($value['form'])) {
            $form = array_diff_key($value['form'], ['fields' => 1, 'field' => 1]);
        } else {
            $form = [];
        }

        $items = isset($this->items[$name]) ? $this->items[$name] : ['type' => '_root', 'form_field' => false];

        $this->items[$name] = $items;
        $this->addProperty($name);

        $prefix = $name ? $name . '.' : '';
        $params = array_intersect_key($form, $this->filter);
        $location = [$name];

        if (isset($value['form']['field'])) {
            $this->parseFormField($name, $value['form']['field'], $params, $prefix, '', $merge, $location);
        } elseif (isset($value['form']['fields'])) {
            $this->parseFormFields($value['form']['fields'], $params, $prefix, '', $merge, $location);
        }

        $this->items[$name] += ['form' => $form];

        return $this;
    }
public function embed ( $ name , array $ value , $ separator = '.' , $ merge = false ) { if ( isset ( $ value [ 'rules' ] ) ) { $ this -> rules = array_merge ( $ this -> rules , $ value [ 'rules' ] ) ; } $ name = $ separator !== '.' ? str_replace ( $ separator , '.' , $ name ) : $ name ; if ( isset ( $ value [ 'form' ] ) ) { $ form = array_diff_key ( $ value [ 'form' ] , [ 'fields' => 1 , 'field' => 1 ] ) ; } else { $ form = [ ] ; } $ items = isset ( $ this -> items [ $ name ] ) ? $ this -> items [ $ name ] : [ 'type' => '_root' , 'form_field' => false ] ; $ this -> items [ $ name ] = $ items ; $ this -> addProperty ( $ name ) ; $ prefix = $ name ? $ name . '.' : '' ; $ params = array_intersect_key ( $ form , $ this -> filter ) ; $ location = [ $ name ] ; if ( isset ( $ value [ 'form' ] [ 'field' ] ) ) { $ this -> parseFormField ( $ name , $ value [ 'form' ] [ 'field' ] , $ params , $ prefix , '' , $ merge , $ location ) ; } elseif ( isset ( $ value [ 'form' ] [ 'fields' ] ) ) { $ this -> parseFormFields ( $ value [ 'form' ] [ 'fields' ] , $ params , $ prefix , '' , $ merge , $ location ) ; } $ this -> items [ $ name ] += [ 'form' => $ form ] ; return $ this ; }
Embed an array to the blueprint.

@param $name
@param array $value
@param string $separator
@param bool $merge   Merge fields instead replacing them.
@return $this
Embed an array to the blueprint .