1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/manual/codes/Mapping object relations - Inheritance - Column aggregation.php
2006-08-21 10:16:36 +00:00

27 lines
697 B
PHP

<?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);
// this column is used for column
// aggregation inheritance
$this->hasColumn("type", "integer", 11);
}
}
class User extends Entity {
public function setUp() {
$this->setInheritanceMap(array("type"=>1));
}
}
class Group extends Entity {
public function setUp() {
$this->setInheritanceMap(array("type"=>2));
}
}
?>