2008-02-09 02:20:35 +03:00
|
|
|
<?php
|
2008-07-21 00:13:24 +04:00
|
|
|
|
2009-01-22 22:38:10 +03:00
|
|
|
namespace Doctrine\Tests\Models\CMS;
|
2008-07-21 00:13:24 +04:00
|
|
|
|
2009-01-05 20:25:56 +03:00
|
|
|
/**
|
2009-01-22 22:38:10 +03:00
|
|
|
* @DoctrineEntity(tableName="cms_users")
|
2009-01-05 20:25:56 +03:00
|
|
|
*/
|
2008-12-18 17:08:11 +03:00
|
|
|
class CmsUser
|
2008-02-09 02:20:35 +03:00
|
|
|
{
|
2009-01-05 20:25:56 +03:00
|
|
|
/**
|
|
|
|
* @DoctrineId
|
|
|
|
* @DoctrineColumn(type="integer")
|
|
|
|
* @DoctrineIdGenerator("auto")
|
|
|
|
*/
|
2008-12-18 17:08:11 +03:00
|
|
|
public $id;
|
2009-01-05 20:25:56 +03:00
|
|
|
/**
|
2009-01-07 20:46:02 +03:00
|
|
|
* @DoctrineColumn(type="varchar", length=50)
|
2009-01-05 20:25:56 +03:00
|
|
|
*/
|
2008-12-18 17:08:11 +03:00
|
|
|
public $status;
|
2009-01-05 20:25:56 +03:00
|
|
|
/**
|
2009-01-07 20:46:02 +03:00
|
|
|
* @DoctrineColumn(type="varchar", length=255)
|
2009-01-05 20:25:56 +03:00
|
|
|
*/
|
2008-12-18 17:08:11 +03:00
|
|
|
public $username;
|
2009-01-05 20:25:56 +03:00
|
|
|
/**
|
2009-01-07 20:46:02 +03:00
|
|
|
* @DoctrineColumn(type="varchar", length=255)
|
2009-01-05 20:25:56 +03:00
|
|
|
*/
|
2008-12-18 17:08:11 +03:00
|
|
|
public $name;
|
2009-01-05 20:25:56 +03:00
|
|
|
/**
|
2009-01-22 22:38:10 +03:00
|
|
|
* @DoctrineOneToMany(targetEntity="Doctrine\Tests\Models\CMS\CmsPhonenumber",
|
|
|
|
mappedBy="user", cascade={"save"})
|
2009-01-05 20:25:56 +03:00
|
|
|
*/
|
2008-12-18 17:08:11 +03:00
|
|
|
public $phonenumbers;
|
2009-01-05 20:25:56 +03:00
|
|
|
/**
|
2009-01-22 22:38:10 +03:00
|
|
|
* @DoctrineOneToMany(targetEntity="Doctrine\Tests\Models\CMS\CmsArticle", mappedBy="user")
|
2009-01-05 20:25:56 +03:00
|
|
|
*/
|
2008-12-18 17:08:11 +03:00
|
|
|
public $articles;
|
2009-01-09 19:25:06 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a phonenumber to the user.
|
|
|
|
*
|
|
|
|
* @param <type> $phone
|
|
|
|
*/
|
|
|
|
public function addPhonenumber(CmsPhonenumber $phone) {
|
|
|
|
$this->phonenumbers[] = $phone;
|
|
|
|
$phone->user = $this;
|
|
|
|
}
|
2008-02-15 03:57:34 +03:00
|
|
|
}
|