$table->addIndex('idx_object_class', array('fields' => 'object_class'));
$table->addIndex('idx_created_at', array('fields' => 'created_at'));
$table->addIndex('idx_action_flag', array('fields' => 'action_flag'));
- $this->option('type', 'INNODB');
- $this->option('collate', 'utf8_unicode_ci');
- $this->option('charset', 'utf8');
+ $table->setOption('type', 'INNODB');
+ $table->setOption('collate', 'utf8_unicode_ci');
+ $table->setOption('charset', 'utf8');
}
$table = $this->getTable();
$table->setTableName('auth_permission');
$this->getTable()->setColumn('name', 'string', 255, array('unique' => true, 'type' => 'string', 'length' => '255'));
- $this->option('type', 'INNODB');
- $this->option('collate', 'utf8_unicode_ci');
- $this->option('charset', 'utf8');
+ $table->setOption('type', 'INNODB');
+ $table->setOption('collate', 'utf8_unicode_ci');
+ $table->setOption('charset', 'utf8');
}
$table = $this->getTable();
$table->setTableName('auth_role');
$this->getTable()->setColumn('name', 'string', 255, array('unique' => true, 'type' => 'string', 'notblank' => true, 'length' => '255'));
- $this->option('type', 'INNODB');
- $this->option('collate', 'utf8_unicode_ci');
- $this->option('charset', 'utf8');
+ $table->setOption('type', 'INNODB');
+ $table->setOption('collate', 'utf8_unicode_ci');
+ $table->setOption('charset', 'utf8');
}
$table->setTableName('auth_role_permission');
$this->getTable()->setColumn('role_id', 'integer', null, array('type' => 'integer', 'primary' => true));
$this->getTable()->setColumn('permission_id', 'integer', null, array('type' => 'integer', 'primary' => true));
- $this->option('type', 'INNODB');
- $this->option('collate', 'utf8_unicode_ci');
- $this->option('charset', 'utf8');
+ $table->setOption('type', 'INNODB');
+ $table->setOption('collate', 'utf8_unicode_ci');
+ $table->setOption('charset', 'utf8');
}
$this->getTable()->setColumn('is_active', 'boolean', null, array('type' => 'boolean', 'notnull' => true, 'default' => false));
$this->getTable()->setColumn('is_superuser', 'boolean', null, array('type' => 'boolean', 'notnull' => true, 'default' => false));
$this->getTable()->setColumn('last_login', 'timestamp', null, array('type' => 'timestamp'));
- $this->option('type', 'INNODB');
- $this->option('collate', 'utf8_unicode_ci');
- $this->option('charset', 'utf8');
+ $table->setOption('type', 'INNODB');
+ $table->setOption('collate', 'utf8_unicode_ci');
+ $table->setOption('charset', 'utf8');
}
$table->setTableName('auth_user_permission');
$this->getTable()->setColumn('user_id', 'integer', null, array('type' => 'integer', 'primary' => true));
$this->getTable()->setColumn('permission_id', 'integer', null, array('type' => 'integer', 'primary' => true));
- $this->option('type', 'INNODB');
- $this->option('collate', 'utf8_unicode_ci');
- $this->option('charset', 'utf8');
+ $table->setOption('type', 'INNODB');
+ $table->setOption('collate', 'utf8_unicode_ci');
+ $table->setOption('charset', 'utf8');
}
$table->setTableName('auth_user_role');
$this->getTable()->setColumn('user_id', 'integer', null, array('type' => 'integer', 'primary' => true));
$this->getTable()->setColumn('role_id', 'integer', null, array('type' => 'integer', 'primary' => true));
- $this->option('type', 'INNODB');
- $this->option('collate', 'utf8_unicode_ci');
- $this->option('charset', 'utf8');
+ $table->setOption('type', 'INNODB');
+ $table->setOption('collate', 'utf8_unicode_ci');
+ $table->setOption('charset', 'utf8');
}
$values = substr($values, 0, strlen($values) - 3);
}
- $build .= " \$this->setAttribute(IPF_ORM::ATTR_" . strtoupper($key) . ", " . $values . ");" . PHP_EOL;
+ $build .= " \$table->setAttribute(IPF_ORM::ATTR_" . strtoupper($key) . ", " . $values . ");" . PHP_EOL;
}
return $build;
{
$build = '';
foreach ($options as $name => $value) {
- $build .= " \$this->option('$name', " . self::varExport($value) . ");" . PHP_EOL;
+ $build .= " \$table->setOption('$name', " . self::varExport($value) . ");" . PHP_EOL;
}
-
return $build;
}
return $this->_table;
}
- public function setAttribute($attr, $value)
- {
- $this->_table->setAttribute($attr, $value);
- }
-
public function setInheritanceMap($map)
{
$this->_table->setOption('inheritanceMap', $map);
}
}
- public function option($name, $value = null)
- {
- if ($value === null) {
- if (is_array($name)) {
- foreach ($name as $k => $v) {
- $this->_table->setOption($k, $v);
- }
- } else {
- return $this->_table->getOption($name);
- }
- } else {
- $this->_table->setOption($name, $value);
- }
- }
-
public function ownsOne()
{
$this->_table->bind(func_get_args(), IPF_ORM_Relation::ONE_COMPOSITE);