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

45 lines
1.1 KiB
PHP
Raw Normal View History

2008-02-09 02:20:35 +03:00
<?php
#namespace Doctrine::Test::ORM::Models;
#use Doctrine::ORM::Entity;
class CmsUser extends Doctrine_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,
'generatorType' => '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->hasMany('CmsPhonenumber as phonenumbers', array(
'local' => 'id', 'foreign' => 'user_id'));
$mapping->hasMany('CmsArticle as articles', array(
2008-05-07 01:03:31 +04:00
'local' => 'id', 'foreign' => 'user_id'));
}
}