@ 2014-07-31T08:06:40Z <?php
namespace MCC\SocialCare\Component\User\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="user")
*/
class User
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @var int
*/
protected $id;
/**
* @ORM\Column(name="first_name", type="string", nullable=true)
* @var string
*/
protected $firstName;
/**
* @ORM\Column(name="last_name", type="string", nullable=true)
* @var string
*/
protected $lastName;
/**
* @ORM\ManyToMany(targetEntity="Role", inversedBy="users", cascade={"persist"}, fetch="EAGER")
* @ORM\JoinTable(name="user_roles")
*
* @var Role[]|Collection
*/
protected $roles;
/**
* @ORM\ManyToMany(targetEntity="Group", inversedBy="users", cascade={"persist"}, fetch="EAGER")
* @ORM\JoinTable(name="user_groups")
*
* @var Group[]|Collection
*/
protected $groups;
/**
* @ORM\ManyToMany(targetEntity="MCC\SocialCare\Component\Team\Entity\Team", mappedBy="users")
*
* @var Team[]|Collection
*/
protected $teams;
/**
* @ORM\OneToMany(targetEntity="MCC\SocialCare\Component\Team\Entity\Team", mappedBy="manager")
*
* @var Team[]|Collection
*/
protected $managedTeams;
/**
* The cases in which the user is a key worker on.
*
* @ORM\OneToMany(
* targetEntity="MCC\SocialCare\Component\ServiceUserCase\Entity\ServiceUserCase",
* mappedBy="keyWorker"
* )
*
* @var ServiceUserCase[]|Collection
*/
protected $keyCases;
/**
* The cases the user is simply involved with.
*
* @ORM\ManyToMany(targetEntity="MCC\SocialCare\Component\ServiceUserCase\Entity\ServiceUserCase", mappedBy="users")
*
* @var Team[]|Collection
*/
protected $cases;
/**
* The users notifications.
*
* @ORM\OneToMany(
* targetEntity="MCC\SocialCare\Component\Notification\Entity\NotificationMessage",
* mappedBy="recipient",
* cascade={"persist"}
* )
*
* @var NotificationMessage[]|Collection
*/
protected $notifications;
public function __construct()
{
parent::__construct();
$this->roles = new ArrayCollection();
$this->groups = new ArrayCollection();
$this->teams = new ArrayCollection();
$this->managedTeams = new ArrayCollection();
$this->keyCases = new ArrayCollection();
$this->cases = new ArrayCollection();
$this->notifications = new ArrayCollection();
}
/**
* @return string
*/
public function getFullName()
{
return $this->firstName.' '.$this->lastName;
}
/**
* {@inheritdoc}
*/
public function setFirstName($firstName)
{
$this->firstName = $firstName;
return $this;
}
/**
* {@inheritdoc}
*/
public function getFirstName()
{
return $this->firstName;
}
/**
* {@inheritdoc}
*/
public function setLastName($lastName)
{
$this->lastName = $lastName;
return $this;
}
/**
* {@inheritdoc}
*/
public function getLastName()
{
return $this->lastName;
}
/**
* @param string|Role $role
* @return User
*/
public function addRole($role)
{
if (!$role instanceof Role) {
$role = (new Role)->setRole($role);
}
if (!$this->hasRole($role)) {
$this->roles->add($role);
}
return $this;
}
/**
* @param string|Role $role
* @return User
*/
public function removeRole($role)
{
if ($role instanceof Role) {
$this->roles->removeElement($role);
return $this;
}
foreach ($this->roles as $r) {
if ($r->getRole() === $role) {
$this->roles->removeElement($r);
}
}
return $this;
}
/**
* @param string|Role $role
* @return bool
*/
public function hasRole($role)
{
if ($role instanceof Role) {
$role = $role->getRole();
}
return $this->roles->exists(function ($key, Role $element) use ($role) {
return $role === $element->getRole();
});
}
/**
* @return Role[]
*/
public function getRoles()
{
$roles = $this->roles->toArray();
foreach ($this->getGroups() as $group) {
$roles = array_merge($roles, $group->getRoles());
}
return $roles;
}
/**
* @param GroupInterface $group
* @return User
*/
public function addGroup(GroupInterface $group)
{
if (!$this->hasGroup($group)) {
$this->groups[] = $group;
}
return $this;
}
/**
* @param GroupInterface $group
* @return User
*/
public function removeGroup(GroupInterface $group)
{
$this->groups->removeElement($group);
return $this;
}
/**
* @param string|GroupInterface $group
* @return bool
*/
public function hasGroup($group)
{
if ($group instanceof GroupInterface) {
return $this->groups->contains($group);
}
return $this->groups->exists(function ($key, GroupInterface $element) use ($group) {
return $group === $element->getName();
});
}
/**
* @return Collection|Group[]
*/
public function getGroups()
{
return $this->groups;
}
/**
* @param Team $team
* @return $this
*/
public function addTeam(Team $team)
{
if (!$this->hasTeam($team)) {
$this->teams->add($team);
$team->addUser($this);
}
return $this;
}
/**
* @param Team $team
* @return $this
*/
public function removeTeam(Team $team)
{
if ($this->hasTeam($team)) {
$this->teams->removeElement($team);
$team->removeUser($this);
}
return $this;
}
/**
* @param Team $team
* @return bool
*/
public function hasTeam(Team $team)
{
return $this->teams->contains($team);
}
/**
* @return Collection|Team[]
*/
public function getTeams()
{
return $this->teams;
}
/**
* @param Team $team
* @return $this
*/
public function addManagedTeam(Team $team)
{
if (!$this->hasManagedTeam($team)) {
$this->managedTeams->add($team);
$team->setManager($this);
}
return $this;
}
/**
* @param Team $team
* @return $this
*/
public function removeManagedTeam(Team $team)
{
if ($this->hasManagedTeam($team)) {
$this->managedTeams->removeElement($team);
$team->setManager(null);
}
return $this;
}
/**
* @param Team $team
* @return bool
*/
public function hasManagedTeam(Team $team)
{
return $this->managedTeams->contains($team);
}
/**
* @return Collection|Team[]
*/
public function getManagedTeams()
{
return $this->managedTeams;
}
/**
* @param ServiceUserCase $keyCase
* @return $this
*/
public function addKeyCase(ServiceUserCase $keyCase)
{
if (!$this->hasKeyCase($keyCase)) {
$this->keyCases->add($keyCase);
$keyCase->setKeyWorker($this);
}
return $this;
}
/**
* @param ServiceUserCase $keyCase
* @return $this
*/
public function removeKeyCase(ServiceUserCase $keyCase)
{
if ($this->hasKeyCase($keyCase)) {
$this->keyCases->removeElement($keyCase);
$keyCase->setKeyWorker(null);
}
return $this;
}
/**
* @param ServiceUserCase $keyCase
* @return bool
*/
public function hasKeyCase(ServiceUserCase $keyCase)
{
return $this->keyCases->contains($keyCase);
}
/**
* @return Collection|ServiceUserCase[]
*/
public function getKeyCases()
{
return $this->keyCases;
}
/**
* @param ServiceUserCase $case
* @return $this
*/
public function addCase(ServiceUserCase $case)
{
if (!$this->hasCase($case)) {
$this->cases->add($case);
$case->addUser($this);
}
return $this;
}
/**
* @param ServiceUserCase $case
* @return $this
*/
public function removeCase(ServiceUserCase $case)
{
if ($this->hasCase($case)) {
$this->cases->removeElement($case);
$case->removeUser($this);
}
return $this;
}
/**
* @param ServiceUserCase $case
* @return bool
*/
public function hasCase(ServiceUserCase $case)
{
return $this->cases->contains($case);
}
/**
* @return Collection|ServiceUserCase[]
*/
public function getCases()
{
return $this->cases;
}
/**
* @param NotificationMessage $message
* @return $this
*/
public function addNotification(NotificationMessage $message)
{
if (!$this->hasNotification($message)) {
$message->setRecipient($this);
$this->notifications->add($message);
}
return $this;
}
/**
* @param NotificationMessage $message
* @return $this
*/
public function removeNotfication(NotificationMessage $message)
{
if ($this->hasNotification($message)) {
$this->notifications->removeElement($message);
$message->setRecipient(null);
}
return $this;
}
/**
* @param NotificationMessage $message
* @return bool
*/
public function hasNotification(NotificationMessage $message)
{
return $this->notifications->contains($message);
}
/**
* @return Collection|NotificationMessage[]
*/
public function getNotifications()
{
return $this->notifications;
}
/**
* Get unread notification messages
*
* @return Collection|NotificationMessage[]
*/
public function getUnreadNotifications()
{
$criteria = Criteria::create()
->where(Criteria::expr()->eq('read', false));
return $this->notifications->matching($criteria);
}
}
var_dump( unserialize('a:4:{i:0;C:41:"MCC\SocialCare\Component\User\Entity\User":206:{a:9:{i:0;s:60:"$2y$15$2m55uqgw1dc0488k0k44kuj5jlsY5zHjNX/WlJ75iKn1NgPX6rcMS";i:1;s:31:"2m55uqgw1dc0488k0k44k0co8wk8csw";i:2;s:10:"superadmin";i:3;s:10:"superadmin";i:4;b:0;i:5;b:0;i:6;b:0;i:7;b:1;i:8;i:12;}}i:1;b:1;i:2;a:2:{i:0;C:41:"MCC\SocialCare\Component\User\Entity\Role":42:{a:2:{i:0;i:3;i:1;s:16:"ROLE_SUPER_ADMIN";}}i:1;r:16;}i:3;a:0:{}}') );
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 8.3.7 0.007 0.007 16.58 8.3.6 0.007 0.007 16.88 8.3.5 0.011 0.007 21.99 8.3.4 0.003 0.011 18.85 8.3.3 0.007 0.011 18.94 8.3.2 0.000 0.007 20.21 8.3.1 0.004 0.004 23.61 8.3.0 0.000 0.008 17.80 8.2.18 0.007 0.015 16.63 8.2.17 0.012 0.003 22.96 8.2.16 0.010 0.003 20.42 8.2.15 0.000 0.008 24.18 8.2.14 0.005 0.003 24.66 8.2.13 0.004 0.004 26.16 8.2.12 0.004 0.004 20.88 8.2.11 0.008 0.000 22.15 8.2.10 0.009 0.003 17.97 8.2.9 0.005 0.003 18.92 8.2.8 0.005 0.003 17.97 8.2.7 0.000 0.008 17.38 8.2.6 0.003 0.005 17.78 8.2.5 0.006 0.003 18.07 8.2.4 0.006 0.003 18.09 8.2.3 0.012 0.000 18.17 8.2.2 0.009 0.000 17.49 8.2.1 0.007 0.000 17.91 8.2.0 0.003 0.005 17.60 8.1.28 0.007 0.007 25.92 8.1.27 0.005 0.003 24.01 8.1.26 0.004 0.004 26.35 8.1.25 0.000 0.008 28.09 8.1.24 0.004 0.004 22.04 8.1.23 0.004 0.007 19.14 8.1.22 0.004 0.004 17.74 8.1.21 0.005 0.003 18.77 8.1.20 0.003 0.006 17.23 8.1.19 0.009 0.000 17.10 8.1.18 0.008 0.000 18.10 8.1.17 0.005 0.003 18.66 8.1.16 0.000 0.007 21.91 8.1.15 0.000 0.007 18.70 8.1.14 0.004 0.004 17.45 8.1.13 0.003 0.003 17.86 8.1.12 0.000 0.008 17.29 8.1.11 0.000 0.008 17.39 8.1.10 0.004 0.004 17.32 8.1.9 0.006 0.003 17.31 8.1.8 0.000 0.007 17.39 8.1.7 0.007 0.000 17.36 8.1.6 0.003 0.005 17.40 8.1.5 0.004 0.004 17.40 8.1.4 0.003 0.006 17.43 8.1.3 0.003 0.006 17.54 8.1.2 0.003 0.006 17.52 8.1.1 0.005 0.002 17.47 8.1.0 0.008 0.000 17.25 8.0.30 0.005 0.002 18.77 8.0.29 0.006 0.003 16.75 8.0.28 0.007 0.000 18.31 8.0.27 0.007 0.000 17.15 8.0.26 0.003 0.003 17.19 8.0.25 0.000 0.007 16.94 8.0.24 0.010 0.000 16.94 8.0.23 0.003 0.005 16.95 8.0.22 0.003 0.003 16.77 8.0.21 0.003 0.003 16.73 8.0.20 0.003 0.003 16.99 8.0.19 0.000 0.007 16.77 8.0.18 0.007 0.000 16.92 8.0.17 0.003 0.006 16.94 8.0.16 0.004 0.004 16.84 8.0.15 0.000 0.007 16.80 8.0.14 0.004 0.004 16.88 8.0.13 0.005 0.000 13.38 8.0.12 0.000 0.008 16.82 8.0.11 0.003 0.005 16.88 8.0.10 0.002 0.005 16.76 8.0.9 0.004 0.004 16.91 8.0.8 0.013 0.010 16.84 8.0.7 0.002 0.005 16.95 8.0.6 0.000 0.007 16.99 8.0.5 0.004 0.004 16.84 8.0.3 0.015 0.007 17.04 8.0.2 0.009 0.009 17.40 8.0.1 0.005 0.003 16.88 8.0.0 0.006 0.013 16.72 7.4.33 0.000 0.005 15.00 7.4.32 0.000 0.007 16.50 7.4.30 0.003 0.003 16.57 7.4.29 0.003 0.003 16.63 7.4.28 0.000 0.008 16.43 7.4.27 0.007 0.000 16.60 7.4.26 0.008 0.004 16.58 7.4.25 0.003 0.006 16.54 7.4.24 0.004 0.004 16.57 7.4.23 0.005 0.003 16.40 7.4.22 0.012 0.009 16.39 7.4.21 0.008 0.008 16.54 7.4.20 0.004 0.004 16.69 7.4.16 0.016 0.000 16.62 7.4.15 0.008 0.011 17.40 7.4.14 0.005 0.015 17.86 7.4.13 0.010 0.008 16.62 7.4.12 0.011 0.007 16.55 7.4.11 0.009 0.009 16.51 7.4.10 0.009 0.009 16.43 7.4.9 0.007 0.016 16.54 7.4.8 0.015 0.006 19.39 7.4.7 0.007 0.010 16.56 7.4.6 0.000 0.017 16.32 7.4.5 0.004 0.000 16.27 7.4.4 0.012 0.006 16.64 7.4.3 0.010 0.006 16.49 7.4.0 0.000 0.015 14.84 7.3.33 0.003 0.003 13.29 7.3.32 0.003 0.003 13.32 7.3.31 0.000 0.008 16.34 7.3.30 0.007 0.000 16.39 7.3.29 0.010 0.007 16.34 7.3.28 0.007 0.010 16.35 7.3.27 0.013 0.003 17.40 7.3.26 0.007 0.010 16.27 7.3.25 0.009 0.009 16.46 7.3.24 0.007 0.011 16.51 7.3.23 0.010 0.007 16.39 7.3.21 0.011 0.007 16.29 7.3.20 0.020 0.003 19.39 7.3.19 0.002 0.003 16.35 7.3.18 0.003 0.014 16.32 7.3.17 0.010 0.013 16.57 7.3.16 0.008 0.009 16.36 7.3.12 0.006 0.008 14.79 7.2.33 0.015 0.006 16.62 7.2.32 0.014 0.004 16.49 7.2.31 0.014 0.010 16.66 7.2.30 0.011 0.007 16.63 7.2.29 0.016 0.007 16.52 7.2.6 0.007 0.007 16.92 7.2.0 0.003 0.013 19.02 7.1.20 0.009 0.004 15.34 7.1.10 0.010 0.003 18.06 7.1.7 0.005 0.003 16.68 7.1.6 0.003 0.020 19.70 7.1.5 0.000 0.024 16.86 7.1.0 0.003 0.077 22.31 7.0.20 0.015 0.006 14.96 7.0.14 0.007 0.070 22.09 7.0.10 0.007 0.083 20.00 7.0.9 0.013 0.067 20.01 7.0.8 0.013 0.073 20.11 7.0.7 0.007 0.050 20.10 7.0.6 0.010 0.047 20.02 7.0.5 0.060 0.070 20.38 7.0.4 0.003 0.080 20.11 7.0.3 0.000 0.087 20.02 7.0.2 0.013 0.077 20.10 7.0.1 0.010 0.080 20.04 7.0.0 0.017 0.070 20.04 5.6.28 0.000 0.073 20.86 5.6.25 0.013 0.077 20.86 5.6.24 0.003 0.083 20.68 5.6.23 0.007 0.080 20.80 5.6.22 0.013 0.077 20.69 5.6.21 0.013 0.073 20.83 5.6.20 0.013 0.047 21.07 5.6.19 0.007 0.057 21.19 5.6.18 0.013 0.047 21.16 5.6.17 0.007 0.043 21.13 5.6.16 0.003 0.083 21.17 5.6.15 0.010 0.047 21.19 5.6.14 0.007 0.047 21.25 5.6.13 0.010 0.083 21.19 5.6.12 0.010 0.080 21.12 5.6.11 0.003 0.083 21.12 5.6.10 0.007 0.087 21.08 5.6.9 0.007 0.083 21.11 5.6.8 0.007 0.070 20.47 5.6.7 0.007 0.077 20.38 5.6.6 0.007 0.063 20.63 5.6.5 0.007 0.053 20.55 5.6.4 0.000 0.043 20.54 5.6.3 0.007 0.040 20.50 5.6.2 0.007 0.033 20.52 5.6.1 0.000 0.043 20.37 5.6.0 0.010 0.033 20.49 5.5.38 0.017 0.080 20.44 5.5.37 0.013 0.070 20.53 5.5.36 0.010 0.067 20.52 5.5.35 0.007 0.080 20.51 5.5.34 0.017 0.073 21.02 5.5.33 0.010 0.093 20.95 5.5.32 0.013 0.073 20.97 5.5.31 0.010 0.070 20.72 5.5.30 0.000 0.090 20.98 5.5.29 0.013 0.073 20.86 5.5.28 0.007 0.083 20.97 5.5.27 0.013 0.080 20.94 5.5.26 0.013 0.080 20.84 5.5.25 0.007 0.067 20.81 5.5.24 0.000 0.077 20.11 5.5.23 0.013 0.067 20.33 5.5.22 0.000 0.067 20.33 5.5.21 0.013 0.033 20.27 5.5.20 0.010 0.033 20.33 5.5.19 0.003 0.057 20.35 5.5.18 0.010 0.040 20.31 5.5.16 0.000 0.043 20.33 5.5.15 0.003 0.040 20.29 5.5.14 0.000 0.043 20.29 5.5.13 0.007 0.037 20.27 5.5.12 0.003 0.070 20.35 5.5.11 0.007 0.063 20.18 5.5.10 0.003 0.050 20.25 5.5.9 0.003 0.053 20.05 5.5.8 0.007 0.037 20.15 5.5.7 0.010 0.053 20.21 5.5.6 0.007 0.033 20.13 5.5.5 0.000 0.043 20.08 5.5.4 0.003 0.047 20.11 5.5.3 0.003 0.040 20.22 5.5.2 0.003 0.040 20.13 5.5.1 0.007 0.040 20.04 5.5.0 0.013 0.047 20.11 5.4.45 0.010 0.070 19.29 5.4.44 0.013 0.073 19.29 5.4.43 0.013 0.040 19.39 5.4.42 0.007 0.080 19.51 5.4.41 0.013 0.073 19.36 5.4.40 0.010 0.067 19.23 5.4.39 0.007 0.067 18.90 5.4.38 0.007 0.050 18.86 5.4.37 0.010 0.040 19.06 5.4.36 0.007 0.053 18.96 5.4.35 0.003 0.040 19.05 5.4.34 0.003 0.040 19.23 5.4.32 0.007 0.037 18.99 5.4.31 0.007 0.050 18.90 5.4.30 0.010 0.073 19.03 5.4.29 0.010 0.043 19.04 5.4.28 0.010 0.043 19.09 5.4.27 0.003 0.040 19.16 5.4.26 0.003 0.037 18.89 5.4.25 0.010 0.063 19.04 5.4.24 0.007 0.040 18.90 5.4.23 0.003 0.043 18.86 5.4.22 0.003 0.040 19.04 5.4.21 0.003 0.047 18.86 5.4.20 0.007 0.033 18.87 5.4.19 0.000 0.040 19.05 5.4.18 0.010 0.030 19.16 5.4.17 0.000 0.040 19.11 5.4.16 0.010 0.030 19.21 5.4.15 0.010 0.033 19.20 5.4.14 0.003 0.037 16.48 5.4.13 0.007 0.037 16.47 5.4.12 0.007 0.037 16.49 5.4.11 0.007 0.033 16.41 5.4.10 0.007 0.037 16.40 5.4.9 0.000 0.043 16.51 5.4.8 0.003 0.033 16.47 5.4.7 0.000 0.037 16.48 5.4.6 0.010 0.057 16.44 5.4.5 0.007 0.040 16.54 5.4.4 0.000 0.040 16.39 5.4.3 0.003 0.050 16.50 5.4.2 0.007 0.067 16.41 5.4.1 0.013 0.060 16.42 5.4.0 0.003 0.067 15.92 5.3.29 0.010 0.067 14.82 5.3.28 0.013 0.050 14.72 5.3.27 0.000 0.040 14.61 5.3.26 0.003 0.037 14.61 5.3.25 0.003 0.043 14.75 5.3.24 0.003 0.037 14.64 5.3.23 0.000 0.040 14.55 5.3.22 0.007 0.033 14.52 5.3.21 0.007 0.033 14.63 5.3.20 0.000 0.040 14.66 5.3.19 0.007 0.033 14.61 5.3.18 0.007 0.037 14.72 5.3.17 0.000 0.043 14.58 5.3.16 0.000 0.040 14.70 5.3.15 0.003 0.043 14.65 5.3.14 0.007 0.060 14.56 5.3.13 0.010 0.067 14.63 5.3.12 0.013 0.070 14.68 5.3.11 0.007 0.077 14.63 5.3.10 0.000 0.060 14.05 5.3.9 0.000 0.080 14.02 5.3.8 0.007 0.073 14.03 5.3.7 0.007 0.050 13.93 5.3.6 0.007 0.037 14.09 5.3.5 0.003 0.070 13.89 5.3.4 0.007 0.073 14.04 5.3.3 0.010 0.070 13.86 5.3.2 0.007 0.073 13.65 5.3.1 0.007 0.073 13.57 5.3.0 0.010 0.063 13.68
preferences:dark mode live preview
47.82 ms | 401 KiB | 5 Q