1
0
mirror of synced 2024-12-14 15:16:04 +03:00
doctrine2/manual/docs/Object relational mapping - Relations - Foreign key associations - Tree structure.php

14 lines
371 B
PHP
Raw Normal View History

2007-04-14 01:49:11 +04:00
<code type="php">
class Task extends Doctrine_Record {
public function setUp() {
$this->hasOne('Task as Parent','Task.parent_id');
$this->hasMany('Task as Subtask','Subtask.parent_id');
}
public function setTableDefinition() {
$this->hasColumn('name','string',100);
$this->hasColumn('parent_id','integer');
}
}
</code>