This commit is contained in:
Greyscale 2019-08-03 02:52:28 +02:00
parent 6940f541e3
commit 7fc42d75d2
3 changed files with 11 additions and 9 deletions

View file

@ -5,5 +5,4 @@ namespace ⌬\Database\Entities;
class Column extends Entity
{
protected $columnName;
}
}

View file

@ -2,7 +2,6 @@
namespace ⌬\Database\Entities;
use ⌬\Migrator\Traits\MySQLSupport;
use ⌬\Migrator\Traits\Support;
abstract class Entity
@ -20,13 +19,13 @@ abstract class Entity
/**
* @param Support $container
*
* @return Entity
*/
public function setContainer(Support $container): Entity
{
$this->container = $container;
return $this;
}
}
}

View file

@ -19,19 +19,23 @@ class Table extends Entity
/**
* @param mixed $tableName
*
* @return Table
*/
public function setTableName($tableName)
{
$this->tableName = $tableName;
return $this;
}
public function addColumn(string $name, array $options) : self
public function addColumn(string $name, array $options): self
{
$this->columns[] = $column = (new Column())
->setContainer($this->getContainer())
->setOptions($options);
->setOptions($options)
;
return $this;
}
}
}