for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SumoCoders\FrameworkMultiUserBundle\Entity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\Role\Role;
/**
* @ORM\Entity
* @ORM\Table
* @ORM\HasLifecycleCallbacks
*/
class UserRole extends Role
{
* @var int
*
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
private $id;
* @var string
* @ORM\Column(type="string")
private $roleName;
* @var DateTime
* @ORM\Column(type="datetime")
private $createdOn;
private $editedOn;
public function __construct(string $roleName)
parent::__construct($roleName);
$this->roleName = $roleName;
}
public function getId(): int
return $this->id;
public function getRole(): string
return $this->roleName;
public function getCreatedOn(): DateTime
return $this->createdOn;
public function getEditedOn(): DateTime
return $this->editedOn;
* @ORM\PrePersist
public function onPrePersist(): void
$this->createdOn = new DateTime();
$this->editedOn = new DateTime();
* @ORM\PreUpdate
public function onPreUpdate(): void
public function __toString(): string