/** * Adds a node type to the bag * * @param NodeTypeContract $nodeType */ public function addNodeType(NodeTypeContract $nodeType) { if (!$this->hasNodeType($nodeType->getKey())) { $this->put($nodeType->getKey(), $nodeType); } }
/** * Destroys a field on a source table and all associated entities * * @param string $name * @param string $tableName * @param NodeTypeContract $nodeType */ public function destroyField($name, $tableName, NodeTypeContract $nodeType) { $this->modelBuilder->build($tableName, $nodeType->getFields()); $this->formBuilder->build($tableName, $nodeType->getFields()); $migration = $this->migrationBuilder->getMigrationClassPathByKey($tableName, $name); $this->migrateDown($migration); $this->migrationBuilder->destroyFieldMigrationForTable($name, $tableName); }