/** * Install inputs for each model. * Encapsulate values if need be by the ` character. * * @return void */ public function run() { $config = Model::$config; foreach ($config as $class => $data) { // Use the blueprint first. if ($blueprint = ModelBlueprint::get($class)) { $arr = $blueprint->getInputsArray(); foreach ($arr as $input) { $this->createIfNotExisting($input); } continue; } // Otherwise, use deprecated stuff. foreach ($data['fields'] as $input) { $this->createIfNotExisting($input); } } echo sizeof($this->created) . " Input objects created.\n"; }
/** * Return the blueprint object from the collection. * @return ModelBlueprint|null */ public static function blueprint() { return ModelBlueprint::get(static::class); }