2007-09-02 18:24:49 +04:00
|
|
|
<?php
|
|
|
|
class TreeLeaf extends Doctrine_Record
|
|
|
|
{
|
|
|
|
public function setTableDefinition()
|
|
|
|
{
|
|
|
|
$this->hasColumn('name', 'string');
|
|
|
|
$this->hasColumn('parent_id', 'integer');
|
|
|
|
}
|
2008-01-23 00:42:17 +03:00
|
|
|
|
2007-09-02 18:24:49 +04:00
|
|
|
public function setUp()
|
|
|
|
{
|
2008-01-23 00:42:17 +03:00
|
|
|
$this->hasOne('TreeLeaf as Parent', array('local' => 'parent_id', 'foreign' => 'id'));
|
|
|
|
$this->hasMany('TreeLeaf as Children', array('local' => 'id', 'foreign' => 'parent_id'));
|
2007-09-02 18:24:49 +04:00
|
|
|
}
|
2008-01-23 00:42:17 +03:00
|
|
|
}
|