1
0
mirror of synced 2025-01-10 11:07:10 +03:00
doctrine2/manual/codes/Object relational mapping - Relations - Join table associations - Self-referencing.php

17 lines
462 B
PHP
Raw Normal View History

2006-07-24 01:08:06 +04:00
<?php
class User extends Doctrine_Record {
public function setUp() {
$this->hasMany('User as Friend','UserReference.user_id-user_id2');
2006-07-24 01:08:06 +04:00
}
public function setTableDefinition() {
$this->hasColumn('name','string',30);
2006-07-24 01:08:06 +04:00
}
}
class UserReference extends Doctrine_Record {
public function setTableDefinition() {
$this->hasColumn('user_id','integer');
$this->hasColumn('user_id2','integer');
2006-07-24 01:08:06 +04:00
}
}
?>