123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?php
-
- namespace Doctrine\Tests\Models\CMS;
-
- use Doctrine\Common\Collections\ArrayCollection;
-
-
- class CmsUser
- {
-
-
- public $id;
-
-
- public $status;
-
-
- public $username;
-
-
- public $name;
-
-
- public $phonenumbers;
-
-
- public $articles;
-
-
- public $address;
-
-
- public $groups;
-
- public function __construct() {
- $this->phonenumbers = new ArrayCollection;
- $this->articles = new ArrayCollection;
- $this->groups = new ArrayCollection;
- }
-
- public function getId() {
- return $this->id;
- }
-
- public function getStatus() {
- return $this->status;
- }
-
- public function getUsername() {
- return $this->username;
- }
-
- public function getName() {
- return $this->name;
- }
-
-
-
- public function addPhonenumber(CmsPhonenumber $phone) {
- $this->phonenumbers[] = $phone;
- $phone->setUser($this);
- }
-
- public function getPhonenumbers() {
- return $this->phonenumbers;
- }
-
- public function addArticle(CmsArticle $article) {
- $this->articles[] = $article;
- $article->setAuthor($this);
- }
-
- public function addGroup(CmsGroup $group) {
- $this->groups[] = $group;
- $group->addUser($this);
- }
-
- public function getGroups() {
- return $this->groups;
- }
-
- public function removePhonenumber($index) {
- if (isset($this->phonenumbers[$index])) {
- $ph = $this->phonenumbers[$index];
- unset($this->phonenumbers[$index]);
- $ph->user = null;
- return true;
- }
- return false;
- }
-
- public function getAddress() { return $this->address; }
-
- public function setAddress(CmsAddress $address) {
- if ($this->address !== $address) {
- $this->address = $address;
- $address->setUser($this);
- }
- }
- }
|