1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/tests/models/cms/CmsPhonenumber.php
2008-12-18 14:08:11 +00:00

33 lines
930 B
PHP
Executable File

<?php
class CmsPhonenumber
{
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');
}*/
public static function initMetadata($mapping)
{
$mapping->mapField(array(
'fieldName' => 'user_id',
'type' => 'integer'
));
$mapping->mapField(array(
'fieldName' => 'phonenumber',
'type' => 'string',
'length' => 50,
'id' => true
));
$mapping->mapManyToOne(array(
'fieldName' => 'user',
'targetEntity' => 'CmsUser',
'joinColumns' => array('user_id' => 'id')
));
}
}