1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/manual/codes/Mapping object relations - Join table associations - Self-referencing.php
2006-07-23 21:08:06 +00:00

17 lines
462 B
PHP

<?php
class User extends Doctrine_Record {
public function setUp() {
$this->hasMany("User as Friend","UserReference.user_id-user_id2");
}
public function setTableDefinition() {
$this->hasColumn("name","string",30);
}
}
class UserReference extends Doctrine_Record {
public function setTableDefinition() {
$this->hasColumn("user_id","integer");
$this->hasColumn("user_id2","integer");
}
}
?>