$result = array();
foreach ($columns as $name => $column) {
$columnName = isset($column['name']) ? $column['name']:$name;
- $build = " ".'$this->hasColumn(\'' . $columnName . '\', \'' . $column['type'] . '\'';
+ $build = " ".'$this->getTable()->setColumn(\'' . $columnName . '\', \'' . $column['type'] . '\'';
if ($column['length']) {
if (is_numeric($column['length']))
return $this;
}
- public function hasColumn($name, $type, $length = 2147483647, $options = "")
- {
- $this->_table->setColumn($name, $type, $length, $options);
- }
-
- public function hasColumns(array $definitions)
- {
- foreach ($definitions as $name => $options) {
- $this->hasColumn($name, $options['type'], $options['length'], $options);
- }
- }
-
public function bindQueryParts(array $queryParts)
{
$this->_table->bindQueryParts($queryParts);
public function setTableDefinition()
{
- $this->hasColumn($this->columnName, 'integer', null, array('exclude' => $this->exclude));
+ $this->getTable()->setColumn($this->columnName, 'integer', null, array('exclude' => $this->exclude));
$this->index($this->getTable()->getOption('tableName') . '_orderable_' . $this->columnName, array('fields' => array($this->columnName)));
$this->getTable()->listeners['Orderable_'.$this->columnName] = new IPF_ORM_Template_Listener_Orderable($this->columnName, $this->prepend);
}
public function setTableDefinition()
{
- $this->hasColumn($this->columnName, 'integer', null, array(
+ $this->getTable()->setColumn($this->columnName, 'integer', null, array(
'exclude' => $this->exclude,
'verbose' => $this->verbose,
));
public function setTableDefinition()
{
- $this->hasColumn($this->_options['name'], $this->_options['type'], $this->_options['length'], $this->_options['options']);
+ $this->getTable()->setColumn($this->_options['name'], $this->_options['type'], $this->_options['length'], $this->_options['options']);
if ($this->_options['unique'] == true && $this->_options['uniqueIndex'] == true && ! empty($this->_options['fields'])) {
$indexFields = array($this->_options['name']);
public function setTableDefinition()
{
if (!$this->_options['created']['disabled']) {
- $this->hasColumn($this->_options['created']['name'], $this->_options['created']['type'], null, $this->_options['created']['options']);
+ $this->getTable()->setColumn($this->_options['created']['name'], $this->_options['created']['type'], null, $this->_options['created']['options']);
}
if (!$this->_options['updated']['disabled']) {
- $this->hasColumn($this->_options['updated']['name'], $this->_options['updated']['type'], null, $this->_options['updated']['options']);
+ $this->getTable()->setColumn($this->_options['updated']['name'], $this->_options['updated']['type'], null, $this->_options['updated']['options']);
}
$this->getTable()->listeners['Timestampable_'.print_r($this->_options, true)] = new IPF_ORM_Template_Listener_Timestampable($this->_options);
}