src/Entity/Role.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\RoleRepository")
  6.  */
  7. class Role
  8. {
  9.     /**
  10.      * @ORM\Id
  11.      * @ORM\GeneratedValue
  12.      * @ORM\Column(type="integer")
  13.      */
  14.     private $id;
  15.     /**
  16.      * @ORM\Column(type="string", length=25, unique=true)
  17.      */
  18.     private $name;
  19.     /**
  20.      * @return mixed
  21.      */
  22.     public function getId()
  23.     {
  24.         return $this->id;
  25.     }
  26.     /**
  27.      * @param mixed $id
  28.      */
  29.     public function setId($id)
  30.     {
  31.         $this->id $id;
  32.     }
  33.     /**
  34.      * @return mixed
  35.      */
  36.     public function getName()
  37.     {
  38.         return $this->name;
  39.     }
  40.     /**
  41.      * @param mixed $name
  42.      */
  43.     public function setName($name)
  44.     {
  45.         $this->name $name;
  46.     }
  47.     /**
  48.      * String representation of object
  49.      * @link http://php.net/manual/en/serializable.serialize.php
  50.      * @return string the string representation of the object or null
  51.      * @since 5.1.0
  52.      */
  53.     public function serialize()
  54.     {
  55.         return serialize(array(
  56.             $this->id,
  57.             $this->name,
  58.         ));
  59.     }
  60. }