1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/tests/models/cms/CmsUser.php

53 lines
1.2 KiB
PHP

<?php
#namespace Doctrine::Test::ORM::Models;
#use Doctrine::ORM::Entity;
class CmsUser extends Doctrine_Entity
{
#protected $id;
#protected $status;
#protected $username;
#protected $name;
public static function initMetadata($mapping)
{
$mapping->mapField(array(
'fieldName' => 'id',
'type' => 'integer',
'length' => 4,
'id' => true,
'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
));
$mapping->mapOneToMany(array(
'fieldName' => 'phonenumbers',
'targetEntity' => 'CmsPhonenumber',
'mappedBy' => 'user'
));
$mapping->mapOneToMany(array(
'fieldName' => 'articles',
'targetEntity' => 'CmsArticle',
'mappedBy' => 'user'
));
}
}