2008-05-06 13:41:22 +00:00
|
|
|
<?php
|
2008-12-18 14:08:11 +00:00
|
|
|
class CmsPhonenumber
|
2008-05-06 13:41:22 +00:00
|
|
|
{
|
2008-12-18 14:08:11 +00:00
|
|
|
public $phonenumber;
|
|
|
|
public $user;
|
|
|
|
|
|
|
|
/*static function construct() {
|
|
|
|
Doctrine_Common_VirtualPropertySystem::register(__CLASS__, 'user_id', 'int');
|
|
|
|
Doctrine_Common_VirtualPropertySystem::register(__CLASS__, 'phonenumber', 'string');
|
|
|
|
Doctrine_Common_VirtualPropertySystem::register(__CLASS__, 'user', 'CmsUser');
|
|
|
|
}*/
|
2008-07-20 20:13:24 +00:00
|
|
|
|
|
|
|
public static function initMetadata($mapping)
|
|
|
|
{
|
|
|
|
$mapping->mapField(array(
|
|
|
|
'fieldName' => 'user_id',
|
2008-12-18 14:08:11 +00:00
|
|
|
'type' => 'integer'
|
2008-07-20 20:13:24 +00:00
|
|
|
));
|
|
|
|
$mapping->mapField(array(
|
|
|
|
'fieldName' => 'phonenumber',
|
|
|
|
'type' => 'string',
|
|
|
|
'length' => 50,
|
|
|
|
'id' => true
|
|
|
|
));
|
2008-08-22 09:05:14 +00:00
|
|
|
|
|
|
|
$mapping->mapManyToOne(array(
|
|
|
|
'fieldName' => 'user',
|
|
|
|
'targetEntity' => 'CmsUser',
|
|
|
|
'joinColumns' => array('user_id' => 'id')
|
|
|
|
));
|
2008-07-20 20:13:24 +00:00
|
|
|
}
|
2008-05-06 13:41:22 +00:00
|
|
|
}
|