2007-04-13 00:52:30 +04:00
|
|
|
|
2007-04-14 01:49:11 +04:00
|
|
|
<code type="php">
|
|
|
|
class User extends Doctrine_Record {
|
|
|
|
public function setUp() {
|
|
|
|
$this->ownsMany('Phonenumber','Phonenumber.user_id');
|
|
|
|
}
|
2007-05-11 20:49:11 +04:00
|
|
|
public function setTableDefinition() {
|
2007-04-14 01:49:11 +04:00
|
|
|
$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');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</code>
|