1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/manual/codes/Mapping object relations - Foreign key associations - One-to-Many, Many-to-One.php
2006-07-23 21:08:06 +00:00

19 lines
553 B
PHP

<?php
class User extends Doctrine_Record {
public function setUp() {
$this->ownsMany("Phonenumber","Phonenumber.user_id");
}
public function setTableDefition() {
$this->hasColumn("name","string",50);
$this->hasColumn("loginname","string",20);
$this->hasColumn("password","string",16);
}
}
class Phonenumber extends Doctrine_Record {
public function setTableDefinition() {
$this->hasColumn("phonenumber","string",50);
$this->hasColumn("user_id","integer");
}
}
?>