}
- public function setUp()
+ public static function setUp(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->addTemplate(new IPF_ORM_Template_Timestampable(array('updated' => array('disabled' => true))));
}
}
- public function setUp()
+ public static function setUp(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->hasMany('User', 'Users', array('refClass' => 'UserPermission', 'local' => 'permission_id', 'foreign' => 'user_id'));
$table->hasMany('Role', 'Roles', array('refClass' => 'RolePermission', 'local' => 'permission_id', 'foreign' => 'role_id'));
$table->hasMany('RolePermission', '', array('local' => 'id', 'foreign' => 'permission_id'));
}
- public function setUp()
+ public static function setUp(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->hasMany('Permission', 'Permissions', array('refClass' => 'RolePermission', 'local' => 'role_id', 'foreign' => 'permission_id'));
$table->hasMany('User', 'Users', array('refClass' => 'UserRole', 'local' => 'role_id', 'foreign' => 'user_id'));
$table->hasMany('RolePermission', '', array('local' => 'id', 'foreign' => 'role_id'));
}
- public function setUp()
+ public static function setUp(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->hasOne('Role', '', array('local' => 'role_id', 'foreign' => 'id', 'onDelete' => 'CASCADE'));
$table->hasOne('Permission', '', array('local' => 'permission_id', 'foreign' => 'id', 'onDelete' => 'CASCADE'));
}
}
- public function setUp()
+ public static function setUp(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->hasMany('Role', 'Roles', array('refClass' => 'UserRole', 'local' => 'user_id', 'foreign' => 'role_id'));
$table->hasMany('Permission', 'Permissions', array('refClass' => 'UserPermission', 'local' => 'user_id', 'foreign' => 'permission_id'));
$table->hasMany('UserRole', '', array('local' => 'id', 'foreign' => 'user_id'));
}
- public function setUp()
+ public static function setUp(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->hasOne('User', '', array('local' => 'user_id', 'foreign' => 'id', 'onDelete' => 'CASCADE'));
$table->hasOne('Permission', '', array('local' => 'permission_id', 'foreign' => 'id', 'onDelete' => 'CASCADE'));
}
}
- public function setUp()
+ public static function setUp(IPF_ORM_Table $table)
{
- $table = $this->getTable();
$table->hasOne('User', '', array('local' => 'user_id', 'foreign' => 'id', 'onDelete' => 'CASCADE'));
$table->hasOne('Role', '', array('local' => 'role_id', 'foreign' => 'id', 'onDelete' => 'CASCADE'));
}
// then we need call the parent::setUp() before the body of the function
// Class table inheritance is the only one we shouldn't call parent::setUp() for
if (count($ret) && isset($definition['inheritance']['type']) && $definition['inheritance']['type'] != 'class_table') {
- array_unshift($ret, ' parent::setUp();');
+ array_unshift($ret, ' parent::setUp($table);');
}
// If we have some code for the function then lets define it and return it
if (count($ret)) {
array_unshift($ret,
- ' public function setUp()',
- ' {',
- ' $table = $this->getTable();'
+ ' public static function setUp(IPF_ORM_Table $table)',
+ ' {'
);
$ret[] = ' }';
}
return self::$_index;
}
- public function setUp(){}
public function construct(){}
public function getOid()
{
}
- public function setUp()
+ public static function setUp(IPF_ORM_Table $table)
{
}
$this->initIdentifier();
- $record = new $name($this);
- $record->setUp();
+ $name::setUp($this);
$this->_filters[] = new IPF_ORM_Record_Filter_Standard();
$this->_repository = new IPF_ORM_Table_Repository($this);