2006-07-24 01:08:06 +04:00
|
|
|
<?php
|
|
|
|
class Entity extends Doctrine_Record {
|
|
|
|
public function setTableDefinition() {
|
|
|
|
$this->hasColumn("name","string",30);
|
|
|
|
$this->hasColumn("username","string",20);
|
|
|
|
$this->hasColumn("password","string",16);
|
|
|
|
$this->hasColumn("created","integer",11);
|
2006-08-21 14:16:36 +04:00
|
|
|
|
|
|
|
// this column is used for column
|
|
|
|
// aggregation inheritance
|
|
|
|
$this->hasColumn("type", "integer", 11);
|
2006-07-24 01:08:06 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class User extends Entity {
|
|
|
|
public function setUp() {
|
2006-08-21 14:16:36 +04:00
|
|
|
$this->setInheritanceMap(array("type"=>1));
|
2006-07-24 01:08:06 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class Group extends Entity {
|
|
|
|
public function setUp() {
|
2006-08-21 14:16:36 +04:00
|
|
|
$this->setInheritanceMap(array("type"=>2));
|
2006-07-24 01:08:06 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|