users = new ArrayCollection(); } /** * @see RoleInterface */ public function getRole() { return $this->role; } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set name * * @param string $name * @return Role */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set name * * @param string $role * @return Role */ public function setRole($role) { $this->role = $role; return $this; } /** * @see \Serializable::serialize() */ public function serialize() { /* * ! Don't serialize $users field ! */ return \serialize(array( $this->id, $this->role )); } /** * @see \Serializable::unserialize() */ public function unserialize($serialized) { list( $this->id, $this->role ) = \unserialize($serialized); } }