2008-02-09 02:20:35 +03:00
|
|
|
<?php
|
2008-07-21 00:13:24 +04:00
|
|
|
|
|
|
|
#namespace Doctrine::Test::ORM::Models;
|
|
|
|
|
|
|
|
#use Doctrine::ORM::Entity;
|
|
|
|
|
2008-05-14 01:20:34 +04:00
|
|
|
class CmsUser extends Doctrine_Entity
|
2008-02-09 02:20:35 +03:00
|
|
|
{
|
2008-07-21 00:13:24 +04: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(
|
2008-05-06 17:41:22 +04:00
|
|
|
'local' => 'id', 'foreign' => 'user_id'));
|
2008-07-21 00:13:24 +04:00
|
|
|
$mapping->hasMany('CmsArticle as articles', array(
|
2008-05-07 01:03:31 +04:00
|
|
|
'local' => 'id', 'foreign' => 'user_id'));
|
2008-07-21 00:13:24 +04:00
|
|
|
}
|
2008-02-15 03:57:34 +03:00
|
|
|
}
|