1
0
mirror of synced 2025-01-10 11:07:10 +03:00
doctrine2/manual/codes/Object relational mapping - Relations - Foreign key associations - One-to-Many, Many-to-One.php

19 lines
553 B
PHP
Raw Normal View History

2006-07-24 01:08:06 +04:00
<?php
class User extends Doctrine_Record {
public function setUp() {
$this->ownsMany('Phonenumber','Phonenumber.user_id');
2006-07-24 01:08:06 +04:00
}
public function setTableDefition() {
$this->hasColumn('name','string',50);
$this->hasColumn('loginname','string',20);
$this->hasColumn('password','string',16);
2006-07-24 01:08:06 +04:00
}
}
class Phonenumber extends Doctrine_Record {
public function setTableDefinition() {
$this->hasColumn('phonenumber','string',50);
$this->hasColumn('user_id','integer');
2006-07-24 01:08:06 +04:00
}
}
?>