infinito/application/symfony/src/Attribut/UserAttribut.php
2019-02-17 14:33:19 +01:00

44 lines
643 B
PHP

<?php
namespace Infinito\Attribut;
use Infinito\Entity\User;
use Infinito\Entity\UserInterface;
/**
* @author kevinfrantz
*
* @see UserAttributInterface
*/
trait UserAttribut
{
/**
* @var User|null
*/
protected $user;
/**
* @param UserInterface $user
*/
public function setUser(UserInterface $user): void
{
$this->user = $user;
}
/**
* @return UserInterface
*/
public function getUser(): UserInterface
{
return $this->user;
}
/**
* @return bool
*/
public function hasUser(): bool
{
return isset($this->user);
}
}