<?php
namespace App\Share\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Share\Model\User as BaseUser;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="mc_admin")
* @method string getUserIdentifier()
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="first_name", type="string", nullable=true)
* @Assert\NotBlank(message="fields.assert.field_mandatory",groups={"Default","UserInfos"})
*/
private $firstName;
/**
* @ORM\Column(name="last_name", type="string", nullable=true)
* @Assert\NotBlank(message="fields.assert.field_mandatory",groups={"Default","UserInfos"})
*/
private $lastName;
/**
* @return string
*/
public function getFirstName()
{
return $this->firstName;
}
/**
* @param string
*
* @return $this
*/
public function setFirstName($firstName)
{
$this->firstName = $firstName;
return $this;
}
/**
* @return string
*/
public function getLastName()
{
return $this->lastName;
}
/**
* @param string
*
* @return $this
*/
public function setLastName($lastName)
{
$this->lastName = $lastName;
return $this;
}
/**
* Override setEmail's FOSUser method, because we don't want a username, but
* first and last names instead, with email logging.
*
* @param string
*
* @return $this
*/
public function setEmail($email)
{
$email = is_null($email) ? '' : $email;
parent::setEmail($email);
$this->setUsername($email);
return $this;
}
public function __call($name, $arguments)
{
// TODO: Implement @method string getUserIdentifier()
}
}