Skip to content

Instantly share code, notes, and snippets.

@doctrinebot
Created December 13, 2015 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doctrinebot/b1c109d9777185aea468 to your computer and use it in GitHub Desktop.
Save doctrinebot/b1c109d9777185aea468 to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-617 - https://github.com/doctrine/doctrine2/issues/5126
<?php
namespace Lms\Entities;
/**
*
* @author Numan
* @Entity(repositoryClass="Lms\Entities\UserRepository")
* @Table(name="User")
*/
class User {
public function __constructor() {
$rolemates = new \Doctrine\Common\Collections\ArrayCollection;
$goal_collaborators = new \Doctrine\Common\Collections\ArrayCollection;
$task_collaborators = new \Doctrine\Common\Collections\ArrayCollection;
$social_media_links = new \Doctrine\Common\Collections\ArrayCollection;
}
/**
* @Id
* @Column(type="bigint")
* @GeneratedValue
*/
protected $id;
/** @Column(type="string", nullable=TRUE, length=1024) */
protected $mission_statement;
/** @Column(type="string") */
protected $first_name;
/** @Column(type="string") */
protected $last_name;
/** @Column(type="string", nullable=TRUE, length=8) */
protected $initial;
/** @Column(type="string", nullable=TRUE) */
protected $email;
/** @Column(type="string", nullable=TRUE) */
protected $company;
/** @Column(type="string", nullable=TRUE, length=1024) */
protected $picture;
/** @Column(type="text", nullable=TRUE) */
protected $bio;
//bidirectional one to many relationship with rolemate
/**
* @OneToMany(targetEntity="Rolemate", mappedBy="rolemate_user")
*/
protected $rolemates;
//bidirectional one to many relationship with goal collaborator
/**
* @OneToMany(targetEntity="GoalCollaborator", mappedBy="goalcollaborator_user")
*/
protected $goal_collaborators;
//bidirectional one to many relationship with task collaborator
/**
* @OneToMany(targetEntity="TaskCollaborator", mappedBy="taskcollaborator_user")
*/
protected $task_collaborators;
// unidirectional one to many relationship with social media link
/**
* @ManyToMany(targetEntity="SocialMediaLink")
* @JoinTable(name="Users_Socialmedialinks",
* joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")},
* inverseJoinColumns={@JoinColumn(name="socialmedialink_id", referencedColumnName="id", unique=true)}
* )
*/
protected $social_media_links;
/**
* Get id
*
* @return bigint $id
*/
public function getId()
{
return $this->id;
}
/**
* Set mission_statement
*
* @param string $missionStatement
*/
public function setMissionStatement($missionStatement)
{
$this->mission_statement = $missionStatement;
}
/**
* Get mission_statement
*
* @return string $missionStatement
*/
public function getMissionStatement()
{
return $this->mission_statement;
}
/**
* Set first_name
*
* @param string $firstName
*/
public function setFirstName($firstName)
{
$this->first_name = $firstName;
}
/**
* Get first_name
*
* @return string $firstName
*/
public function getFirstName()
{
return $this->first_name;
}
/**
* Set last_name
*
* @param string $lastName
*/
public function setLastName($lastName)
{
$this->last_name = $lastName;
}
/**
* Get last_name
*
* @return string $lastName
*/
public function getLastName()
{
return $this->last_name;
}
/**
* Set initial
*
* @param string $initial
*/
public function setInitial($initial)
{
$this->initial = $initial;
}
/**
* Get initial
*
* @return string $initial
*/
public function getInitial()
{
return $this->initial;
}
/**
* Set email
*
* @param string $email
*/
public function setEmail($email)
{
$this->email = $email;
}
/**
* Get email
*
* @return string $email
*/
public function getEmail()
{
return $this->email;
}
/**
* Set company
*
* @param string $company
*/
public function setCompany($company)
{
$this->company = $company;
}
/**
* Get company
*
* @return string $company
*/
public function getCompany()
{
return $this->company;
}
/**
* Set picture
*
* @param string $picture
*/
public function setPicture($picture)
{
$this->picture = $picture;
}
/**
* Get picture
*
* @return string $picture
*/
public function getPicture()
{
return $this->picture;
}
/**
* Set bio
*
* @param text $bio
*/
public function setBio($bio)
{
$this->bio = $bio;
}
/**
* Get bio
*
* @return text $bio
*/
public function getBio()
{
return $this->bio;
}
/**
* Add rolemates
*
* @param Rolemate $rolemates
*/
public function addRolemates(\Rolemate $rolemates)
{
$this->rolemates[] = $rolemates;
}
/**
* Get rolemates
*
* @return Doctrine\Common\Collections\Collection $rolemates
*/
public function getRolemates()
{
return $this->rolemates;
}
/**
* Add goal_collaborators
*
* @param GoalCollaborator $goalCollaborators
*/
public function addGoalCollaborators(\GoalCollaborator $goalCollaborators)
{
$this->goal_collaborators[] = $goalCollaborators;
}
/**
* Get goal_collaborators
*
* @return Doctrine\Common\Collections\Collection $goalCollaborators
*/
public function getGoalCollaborators()
{
return $this->goal_collaborators;
}
/**
* Add task_collaborators
*
* @param TaskCollaborator $taskCollaborators
*/
public function addTaskCollaborators(\TaskCollaborator $taskCollaborators)
{
$this->task_collaborators[] = $taskCollaborators;
}
/**
* Get task_collaborators
*
* @return Doctrine\Common\Collections\Collection $taskCollaborators
*/
public function getTaskCollaborators()
{
return $this->task_collaborators;
}
/**
* Add social_media_links
*
* @param SocialMediaLink $socialMediaLinks
*/
public function addSocialMediaLinks(\SocialMediaLink $socialMediaLinks)
{
$this->social_media_links[] = $socialMediaLinks;
}
/**
* Get social_media_links
*
* @return Doctrine\Common\Collections\Collection $socialMediaLinks
*/
public function getSocialMediaLinks()
{
return $this->social_media_links;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment