App\Source\ModelFieldBuilder\BuildFields::addJsonShema PHP Метод

addJsonShema() публичный Метод

public addJsonShema ( $jsonShema = '' )
    public function addJsonShema($jsonShema = '')
    {
        if (!is_array($jsonShema)) {
            return $this;
        }
        $neededObject = array_filter($jsonShema, function ($e) {
            return $e->name == "default";
        });
        if ($neededObject) {
            $this->setDefaultObject(current($neededObject));
        }
        while ($item = array_shift($jsonShema)) {
            if (is_object($item) && $item->name) {
                $item = (object) array_merge((array) $this->defaultObject, (array) $item);
                $this->add($item);
            }
        }
        return $this;
    }