src/Fields/Bundle.php
public function build($args)
    {
        $data = [];

        $args = Cuztom::merge($args, [
            'parent'   => $this,
            'metaType' => $this->metaType,
            'object'   => $this->object,
        ]);

        // Build with value
        if (Cuztom::isArray($this->value)) {
            $i = 0;

            foreach ($this->value as $value) {
                $args = Cuztom::merge($args, "index=>$i");

                $data[] = new BundleItem($args, $value);

                $i++;
            }
        }

        // Without value
        else {
            $args = Cuztom::merge($args, 'index=>0');

            $data[] = new BundleItem($args);
        }

        return $data;
    }
public function build($args)
    {
        $data = [];

        $args = Cuztom::merge($args, [
            'parent'   => $this,
            'metaType' => $this->metaType,
            'object'   => $this->object,
        ]);

        // Build with value
        if (Cuztom::isArray($this->value)) {
            $i = 0;

            foreach ($this->value as $value) {
                $args = Cuztom::merge($args, "index=>$i");

                $data[] = new BundleItem($args, $value);

                $i++;
            }
        }

        // Without value
        else {
            $args = Cuztom::merge($args, 'index=>0');

            $data[] = new BundleItem($args);
        }

        return $data;
    }
public function build ( $ args ) { $ data = [ ] ; $ args = Cuztom :: merge ( $ args , [ 'parent' => $ this , 'metaType' => $ this -> metaType , 'object' => $ this -> object , ] ) ; // Build with value if ( Cuztom :: isArray ( $ this -> value ) ) { $ i = 0 ; foreach ( $ this -> value as $ value ) { $ args = Cuztom :: merge ( $ args , "index=>$i" ) ; $ data [ ] = new BundleItem ( $ args , $ value ) ; $ i ++ ; } } // Without value else { $ args = Cuztom :: merge ( $ args , 'index=>0' ) ; $ data [ ] = new BundleItem ( $ args ) ; } return $ data ; }
This method builds the complete array for a bundle.

@param array $data
@param array $values
This method builds the complete array for a bundle .