コード例 #1
0
ファイル: NodeTypeBag.php プロジェクト: NuclearCMS/Hierarchy
 /**
  * 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);
     }
 }
コード例 #2
0
 /**
  * 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);
 }