1
0
mirror of synced 2024-12-14 07:06:04 +03:00
doctrine2/tests/models/cms/CmsUser.php

53 lines
1.2 KiB
PHP
Raw Normal View History

2008-02-09 02:20:35 +03:00
<?php
#namespace Doctrine::Test::ORM::Models;
#use Doctrine::ORM::Entity;
2008-09-12 14:40:23 +04:00
class CmsUser extends Doctrine_ORM_Entity
2008-02-09 02:20:35 +03:00
{
#protected $id;
#protected $status;
#protected $username;
#protected $name;
public static function initMetadata($mapping)
{
$mapping->mapField(array(
'fieldName' => 'id',
'type' => 'integer',
'length' => 4,
'id' => true,
2008-07-27 23:38:56 +04:00
'idGenerator' => 'auto'
));
$mapping->mapField(array(
'fieldName' => 'status',
'type' => 'string',
'length' => 50
));
$mapping->mapField(array(
'fieldName' => 'username',
'type' => 'string',
'length' => 255
));
$mapping->mapField(array(
'fieldName' => 'name',
'type' => 'string',
'length' => 255
));
2008-08-16 23:40:59 +04:00
$mapping->mapOneToMany(array(
'fieldName' => 'phonenumbers',
'targetEntity' => 'CmsPhonenumber',
'mappedBy' => 'user'
2008-08-16 23:40:59 +04:00
));
$mapping->mapOneToMany(array(
'fieldName' => 'articles',
'targetEntity' => 'CmsArticle',
'mappedBy' => 'user'
2008-08-16 23:40:59 +04:00
));
}
}