abstract class BaseAdminLog extends IPF_ORM_Record
{
- public function setTableDefinition()
+ public static function setTableDefinition(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->setTableName('admin_log');
$table->setColumn('username', 'string', 32, array('type' => 'string', 'length' => '32'));
$table->setColumn('user_id', 'integer', null, array('type' => 'integer'));
abstract class BasePermission extends IPF_ORM_Record
{
- public function setTableDefinition()
+ public static function setTableDefinition(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->setTableName('auth_permission');
$table->setColumn('name', 'string', 255, array('unique' => true, 'type' => 'string', 'length' => '255'));
$table->setOption('type', 'INNODB');
abstract class BaseRole extends IPF_ORM_Record
{
- public function setTableDefinition()
+ public static function setTableDefinition(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->setTableName('auth_role');
$table->setColumn('name', 'string', 255, array('unique' => true, 'type' => 'string', 'notblank' => true, 'length' => '255'));
$table->setOption('type', 'INNODB');
abstract class BaseRolePermission extends IPF_ORM_Record
{
- public function setTableDefinition()
+ public static function setTableDefinition(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->setTableName('auth_role_permission');
$table->setColumn('role_id', 'integer', null, array('type' => 'integer', 'primary' => true));
$table->setColumn('permission_id', 'integer', null, array('type' => 'integer', 'primary' => true));
abstract class BaseUser extends IPF_ORM_Record
{
- public function setTableDefinition()
+ public static function setTableDefinition(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->setTableName('auth_user');
$table->setColumn('username', 'string', 32, array('type' => 'string', 'notblank' => true, 'notnull' => true, 'unique' => true, 'length' => '32'));
$table->setColumn('password', 'string', 128, array('type' => 'string', 'notblank' => true, 'notnull' => true, 'length' => '128'));
abstract class BaseUserPermission extends IPF_ORM_Record
{
- public function setTableDefinition()
+ public static function setTableDefinition(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->setTableName('auth_user_permission');
$table->setColumn('user_id', 'integer', null, array('type' => 'integer', 'primary' => true));
$table->setColumn('permission_id', 'integer', null, array('type' => 'integer', 'primary' => true));
abstract class BaseUserRole extends IPF_ORM_Record
{
- public function setTableDefinition()
+ public static function setTableDefinition(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->setTableName('auth_user_role');
$table->setColumn('user_id', 'integer', null, array('type' => 'integer', 'primary' => true));
$table->setColumn('role_id', 'integer', null, array('type' => 'integer', 'primary' => true));
}
$ret = array(
- ' public function setTableDefinition()',
+ ' public static function setTableDefinition(IPF_ORM_Table $table)',
' {',
- ' $table = $this->getTable();',
);
if (isset($definition['inheritance']['type']) && $definition['inheritance']['type'] == 'concrete')
- $ret[] = " parent::setTableDefinition();";
+ $ret[] = ' parent::setTableDefinition($table);';
if (isset($definition['tableName']) && !empty($definition['tableName']))
$ret[] = " ".'$table->setTableName(\''. $definition['tableName'].'\');';
{
protected $_table;
- public function setTableDefinition()
+ public static function setTableDefinition(IPF_ORM_Table $table)
{
}
$this->initParents($name);
// create database table
- $record = new $name($this);
- $record->setTableDefinition();
+ $name::setTableDefinition($this);
$this->columnCount = count($this->_columns);
$this->initIdentifier();
+ $record = new $name($this);
$record->setUp();
$this->_filters[] = new IPF_ORM_Record_Filter_Standard();
abstract class BaseSession extends IPF_ORM_Record
{
- public function setTableDefinition()
+ public static function setTableDefinition(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->setTableName('session');
$table->setColumn('session_key', 'string', 40, array('primary' => true, 'type' => 'string', 'length' => '40'));
$table->setColumn('session_data', 'string', null, array('type' => 'string'));