1
0
mirror of synced 2025-01-09 10:37:09 +03:00
doctrine2/manual/codes/Object relational mapping - Relations - Foreign key associations - Tree structure.php

13 lines
365 B
PHP
Raw Normal View History

2006-07-24 01:08:06 +04:00
<?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');
2006-07-24 01:08:06 +04:00
}
public function setTableDefinition() {
$this->hasColumn('name','string',100);
$this->hasColumn('parent_id','integer');
2006-07-24 01:08:06 +04:00
}
}
?>