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