2019-03-20 23:16:07 +01:00
|
|
|
<?php
|
2019-08-12 15:47:57 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* part-db version 0.1
|
|
|
|
* Copyright (C) 2005 Christoph Lechner
|
|
|
|
* http://www.cl-projects.de/
|
|
|
|
*
|
|
|
|
* part-db version 0.2+
|
|
|
|
* Copyright (C) 2009 K. Jacobs and others (see authors.php)
|
|
|
|
* http://code.google.com/p/part-db/
|
|
|
|
*
|
|
|
|
* Part-DB Version 0.4+
|
|
|
|
* Copyright (C) 2016 - 2019 Jan Böhmer
|
|
|
|
* https://github.com/jbtronics
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*
|
|
|
|
*/
|
2019-03-20 23:16:07 +01:00
|
|
|
|
|
|
|
declare(strict_types=1);
|
2019-03-14 18:01:41 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* part-db version 0.1
|
|
|
|
* Copyright (C) 2005 Christoph Lechner
|
2019-03-20 23:16:07 +01:00
|
|
|
* http://www.cl-projects.de/.
|
2019-03-14 18:01:41 +01:00
|
|
|
*
|
|
|
|
* part-db version 0.2+
|
|
|
|
* Copyright (C) 2009 K. Jacobs and others (see authors.php)
|
|
|
|
* http://code.google.com/p/part-db/
|
|
|
|
*
|
|
|
|
* Part-DB Version 0.4+
|
|
|
|
* Copyright (C) 2016 - 2019 Jan Böhmer
|
|
|
|
* https://github.com/jbtronics
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2019-08-12 15:47:57 +02:00
|
|
|
namespace App\Entity\UserSystem;
|
2019-03-14 18:01:41 +01:00
|
|
|
|
2019-08-12 15:47:57 +02:00
|
|
|
use App\Entity\Base\NamedDBElement;
|
2019-03-18 19:05:41 +01:00
|
|
|
use App\Security\Interfaces\HasPermissionsInterface;
|
2019-08-12 21:47:25 +02:00
|
|
|
use App\Validator\Constraints\Selectable;
|
2019-03-14 18:01:41 +01:00
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
use Symfony\Component\Security\Core\User\UserInterface;
|
2019-03-15 18:04:15 +01:00
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
2019-03-14 18:01:41 +01:00
|
|
|
|
|
|
|
/**
|
2019-03-15 13:18:47 +01:00
|
|
|
* This entity represents a user, which can log in and have permissions.
|
|
|
|
* Also this entity is able to save some informations about the user, like the names, email-address and other info.
|
|
|
|
*
|
2019-03-14 18:01:41 +01:00
|
|
|
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
|
2019-08-06 13:18:29 +02:00
|
|
|
* @ORM\Table("`users`")
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
2019-03-18 19:05:41 +01:00
|
|
|
class User extends NamedDBElement implements UserInterface, HasPermissionsInterface
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
2019-03-19 17:17:04 +01:00
|
|
|
/** The User id of the anonymous user */
|
2019-03-20 23:16:07 +01:00
|
|
|
public const ID_ANONYMOUS = 1;
|
2019-03-19 17:17:04 +01:00
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
/**
|
|
|
|
* @ORM\Id()
|
|
|
|
* @ORM\GeneratedValue()
|
|
|
|
* @ORM\Column(type="integer")
|
|
|
|
*/
|
|
|
|
protected $id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Column(type="string", length=180, unique=true)
|
2019-03-15 18:04:15 +01:00
|
|
|
* @Assert\NotBlank
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
2019-08-20 18:39:57 +02:00
|
|
|
protected $name = '';
|
2019-03-14 18:01:41 +01:00
|
|
|
|
|
|
|
/**
|
2019-03-20 23:16:07 +01:00
|
|
|
* //@ORM\Column(type="json").
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
|
|
|
//protected $roles = [];
|
|
|
|
|
|
|
|
/**
|
2019-03-15 18:04:15 +01:00
|
|
|
* @var string|null The hashed password
|
|
|
|
* @ORM\Column(type="string", nullable=true)
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
|
|
|
protected $password;
|
|
|
|
|
2019-03-20 12:27:11 +01:00
|
|
|
/**
|
|
|
|
* @var bool True if the user needs to change password after log in
|
|
|
|
* @ORM\Column(type="boolean")
|
|
|
|
*/
|
2019-04-28 14:18:11 +02:00
|
|
|
protected $need_pw_change = true;
|
2019-03-20 12:27:11 +01:00
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
/**
|
2019-03-15 18:04:15 +01:00
|
|
|
* @var string|null The first name of the User
|
|
|
|
* @ORM\Column(type="string", length=255, nullable=true)
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
2019-03-20 22:53:06 +01:00
|
|
|
protected $first_name = '';
|
2019-03-14 18:01:41 +01:00
|
|
|
|
|
|
|
/**
|
2019-03-15 18:04:15 +01:00
|
|
|
* @var string|null The last name of the User
|
|
|
|
* @ORM\Column(type="string", length=255, nullable=true)
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
2019-03-20 22:53:06 +01:00
|
|
|
protected $last_name = '';
|
2019-03-14 18:01:41 +01:00
|
|
|
|
|
|
|
/**
|
2019-03-15 18:04:15 +01:00
|
|
|
* @var string|null The department the user is working
|
|
|
|
* @ORM\Column(type="string", length=255, nullable=true)
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
2019-03-20 22:53:06 +01:00
|
|
|
protected $department = '';
|
2019-03-14 18:01:41 +01:00
|
|
|
|
|
|
|
/**
|
2019-03-15 18:04:15 +01:00
|
|
|
* @var string|null The email address of the user
|
|
|
|
* @ORM\Column(type="string", length=255, nullable=true)
|
|
|
|
* @Assert\Email()
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
2019-03-20 22:53:06 +01:00
|
|
|
protected $email = '';
|
2019-03-14 18:01:41 +01:00
|
|
|
|
|
|
|
/**
|
2019-03-15 18:04:15 +01:00
|
|
|
* @var string|null The language/locale the user prefers
|
|
|
|
* @ORM\Column(type="string", name="config_language", nullable=true)
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
2019-03-20 22:53:06 +01:00
|
|
|
protected $language = '';
|
2019-03-14 18:01:41 +01:00
|
|
|
|
|
|
|
/**
|
2019-03-15 18:04:15 +01:00
|
|
|
* @var string|null The timezone the user prefers
|
|
|
|
* @ORM\Column(type="string", name="config_timezone", nullable=true)
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
2019-03-20 22:53:06 +01:00
|
|
|
protected $timezone = '';
|
2019-03-14 18:01:41 +01:00
|
|
|
|
|
|
|
/**
|
2019-03-15 18:04:15 +01:00
|
|
|
* @var string|null The theme
|
|
|
|
* @ORM\Column(type="string", name="config_theme", nullable=true)
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
2019-03-20 22:53:06 +01:00
|
|
|
protected $theme = '';
|
2019-03-15 13:18:47 +01:00
|
|
|
|
|
|
|
/**
|
2019-03-20 23:16:07 +01:00
|
|
|
* @var Group|null the group this user belongs to
|
2019-03-18 19:05:41 +01:00
|
|
|
* @ORM\ManyToOne(targetEntity="Group", inversedBy="users", fetch="EAGER")
|
2019-03-15 13:18:47 +01:00
|
|
|
* @ORM\JoinColumn(name="group_id", referencedColumnName="id")
|
2019-08-12 21:47:25 +02:00
|
|
|
* @Selectable()
|
2019-03-15 13:18:47 +01:00
|
|
|
*/
|
|
|
|
protected $group;
|
2019-03-14 18:01:41 +01:00
|
|
|
|
2019-03-18 19:05:41 +01:00
|
|
|
/** @var PermissionsEmbed
|
|
|
|
* @ORM\Embedded(class="PermissionsEmbed", columnPrefix="perms_")
|
|
|
|
*/
|
|
|
|
protected $permissions;
|
|
|
|
|
2019-08-06 13:18:29 +02:00
|
|
|
/**
|
|
|
|
* @ORM\Column(type="string", name="config_currency")
|
|
|
|
*/
|
|
|
|
protected $currency;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Column(type="text", name="config_image_path")
|
|
|
|
*/
|
|
|
|
protected $image_path;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Column(type="text", name="config_instock_comment_w")
|
|
|
|
*/
|
|
|
|
protected $instock_comment_w;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Column(type="text", name="config_instock_comment_a")
|
|
|
|
*/
|
|
|
|
protected $instock_comment_a;
|
|
|
|
|
2019-03-19 17:17:04 +01:00
|
|
|
/**
|
|
|
|
* Checks if the current user, is the user which represents the not logged in (anonymous) users.
|
2019-03-20 23:16:07 +01:00
|
|
|
*
|
|
|
|
* @return bool true if this user is the anonymous user
|
2019-03-19 17:17:04 +01:00
|
|
|
*/
|
2019-03-20 23:16:07 +01:00
|
|
|
public function isAnonymousUser(): bool
|
2019-03-19 17:17:04 +01:00
|
|
|
{
|
2019-03-20 23:16:07 +01:00
|
|
|
return $this->id === static::ID_ANONYMOUS && 'anonymous' === $this->name;
|
2019-03-19 17:17:04 +01:00
|
|
|
}
|
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
/**
|
|
|
|
* A visual identifier that represents this user.
|
|
|
|
*
|
|
|
|
* @see UserInterface
|
|
|
|
*/
|
|
|
|
public function getUsername(): string
|
|
|
|
{
|
|
|
|
return (string) $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see UserInterface
|
|
|
|
*/
|
|
|
|
public function getRoles(): array
|
|
|
|
{
|
|
|
|
$roles = [];
|
|
|
|
//$roles = $this->roles;
|
|
|
|
// guarantee every user at least has ROLE_USER
|
|
|
|
$roles[] = 'ROLE_USER';
|
|
|
|
|
|
|
|
return array_unique($roles);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setRoles(array $roles): self
|
|
|
|
{
|
|
|
|
//$this->roles = $roles;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see UserInterface
|
2019-03-15 18:38:45 +01:00
|
|
|
* Gets the password hash for this entity.
|
2019-03-14 18:01:41 +01:00
|
|
|
*/
|
|
|
|
public function getPassword(): string
|
|
|
|
{
|
|
|
|
return (string) $this->password;
|
|
|
|
}
|
|
|
|
|
2019-03-15 18:38:45 +01:00
|
|
|
/**
|
|
|
|
* Sets the password hash for this user.
|
2019-03-20 23:16:07 +01:00
|
|
|
*
|
2019-03-15 18:38:45 +01:00
|
|
|
* @param string $password
|
2019-03-20 23:16:07 +01:00
|
|
|
*
|
2019-03-15 18:38:45 +01:00
|
|
|
* @return User
|
|
|
|
*/
|
2019-03-14 18:01:41 +01:00
|
|
|
public function setPassword(string $password): self
|
|
|
|
{
|
|
|
|
$this->password = $password;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see UserInterface
|
|
|
|
*/
|
|
|
|
public function getSalt()
|
|
|
|
{
|
|
|
|
// not needed when using the "bcrypt" algorithm in security.yaml
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see UserInterface
|
|
|
|
*/
|
|
|
|
public function eraseCredentials()
|
|
|
|
{
|
|
|
|
// If you store any temporary, sensitive data on the user, clear it here
|
|
|
|
// $this->plainPassword = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the ID as an string, defined by the element class.
|
|
|
|
* This should have a form like P000014, for a part with ID 14.
|
2019-03-20 23:16:07 +01:00
|
|
|
*
|
2019-03-14 18:01:41 +01:00
|
|
|
* @return string The ID as a string;
|
|
|
|
*/
|
|
|
|
public function getIDString(): string
|
|
|
|
{
|
2019-03-20 23:16:07 +01:00
|
|
|
return 'U'.sprintf('%06d', $this->getID());
|
2019-03-14 18:01:41 +01:00
|
|
|
}
|
|
|
|
|
2019-03-20 23:16:07 +01:00
|
|
|
public function getPermissions(): PermissionsEmbed
|
2019-03-18 19:05:41 +01:00
|
|
|
{
|
|
|
|
return $this->permissions;
|
|
|
|
}
|
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
/************************************************
|
|
|
|
* Getters
|
|
|
|
************************************************/
|
|
|
|
|
2019-03-20 12:27:11 +01:00
|
|
|
/**
|
|
|
|
* Returns the full name in the format FIRSTNAME LASTNAME [(USERNAME)].
|
2019-03-20 23:16:07 +01:00
|
|
|
* Example: Max Muster (m.muster).
|
|
|
|
*
|
|
|
|
* @param bool $including_username include the username in the full name
|
|
|
|
*
|
|
|
|
* @return string a string with the full name of this user
|
2019-03-20 12:27:11 +01:00
|
|
|
*/
|
2019-03-20 23:16:07 +01:00
|
|
|
public function getFullName(bool $including_username = false): string
|
2019-03-20 12:27:11 +01:00
|
|
|
{
|
2019-03-20 23:16:07 +01:00
|
|
|
$str = $this->getFirstName().' '.$this->getLastName();
|
2019-03-20 12:27:11 +01:00
|
|
|
if ($including_username) {
|
2019-03-20 23:16:07 +01:00
|
|
|
$str .= ' ('.$this->getName().')';
|
2019-03-20 12:27:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return $str;
|
|
|
|
}
|
|
|
|
|
2019-03-20 23:16:07 +01:00
|
|
|
public function setName(string $new_name): NamedDBElement
|
2019-03-19 17:17:04 +01:00
|
|
|
{
|
|
|
|
// Anonymous user is not allowed to change its username
|
2019-03-20 23:16:07 +01:00
|
|
|
if (!$this->isAnonymousUser()) {
|
2019-03-19 17:17:04 +01:00
|
|
|
$this->name = $new_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function getFirstName(): ?string
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
return $this->first_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $first_name
|
2019-03-20 23:16:07 +01:00
|
|
|
*
|
2019-03-14 18:01:41 +01:00
|
|
|
* @return User
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function setFirstName(?string $first_name): User
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
$this->first_name = $first_name;
|
2019-03-20 23:16:07 +01:00
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function getLastName(): ?string
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
return $this->last_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $last_name
|
2019-03-20 23:16:07 +01:00
|
|
|
*
|
2019-03-14 18:01:41 +01:00
|
|
|
* @return User
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function setLastName(?string $last_name): User
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
$this->last_name = $last_name;
|
2019-03-20 23:16:07 +01:00
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function getDepartment(): ?string
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
return $this->department;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $department
|
2019-03-20 23:16:07 +01:00
|
|
|
*
|
2019-03-14 18:01:41 +01:00
|
|
|
* @return User
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function setDepartment(?string $department): User
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
$this->department = $department;
|
2019-03-20 23:16:07 +01:00
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function getEmail(): ?string
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
return $this->email;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $email
|
2019-03-20 23:16:07 +01:00
|
|
|
*
|
2019-03-14 18:01:41 +01:00
|
|
|
* @return User
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function setEmail(?string $email): User
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
$this->email = $email;
|
2019-03-20 23:16:07 +01:00
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function getLanguage(): ?string
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
return $this->language;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $language
|
2019-03-20 23:16:07 +01:00
|
|
|
*
|
2019-03-14 18:01:41 +01:00
|
|
|
* @return User
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function setLanguage(?string $language): User
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
$this->language = $language;
|
2019-03-20 23:16:07 +01:00
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function getTimezone(): ?string
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
return $this->timezone;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $timezone
|
2019-03-20 23:16:07 +01:00
|
|
|
*
|
2019-03-14 18:01:41 +01:00
|
|
|
* @return User
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function setTimezone(?string $timezone): User
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
$this->timezone = $timezone;
|
2019-03-20 23:16:07 +01:00
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function getTheme(): ?string
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
return $this->theme;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $theme
|
2019-03-20 23:16:07 +01:00
|
|
|
*
|
2019-03-14 18:01:41 +01:00
|
|
|
* @return User
|
|
|
|
*/
|
2019-03-15 18:04:15 +01:00
|
|
|
public function setTheme(?string $theme): User
|
2019-03-14 18:01:41 +01:00
|
|
|
{
|
|
|
|
$this->theme = $theme;
|
2019-03-20 23:16:07 +01:00
|
|
|
|
2019-03-14 18:01:41 +01:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2019-03-15 13:18:47 +01:00
|
|
|
public function getGroup(): ?Group
|
|
|
|
{
|
|
|
|
return $this->group;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setGroup(?Group $group): self
|
|
|
|
{
|
|
|
|
$this->group = $group;
|
2019-03-20 23:16:07 +01:00
|
|
|
|
2019-03-15 13:18:47 +01:00
|
|
|
return $this;
|
|
|
|
}
|
2019-04-28 14:18:11 +02:00
|
|
|
|
|
|
|
public function __toString()
|
|
|
|
{
|
|
|
|
return $this->getFullName(true);
|
|
|
|
}
|
2019-03-14 18:01:41 +01:00
|
|
|
}
|