|
@@ -14,6 +14,7 @@ namespace Packagist\WebBundle\Entity;
|
|
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
+use Symfony\Component\Validator\Constraints as Assert;
|
|
|
use FOS\UserBundle\Model\User as BaseUser;
|
|
|
|
|
|
/**
|
|
@@ -61,6 +62,24 @@ class User extends BaseUser
|
|
|
*/
|
|
|
protected $id;
|
|
|
|
|
|
+ /**
|
|
|
+ * @Assert\Length(
|
|
|
+ * min=8,
|
|
|
+ * max=180,
|
|
|
+ * groups={"Profile", "Registration"}
|
|
|
+ * )
|
|
|
+ * @Assert\Regex(
|
|
|
+ * pattern="{^[^/""\r\n><#\[\]]{2,100}$}",
|
|
|
+ * message="Username invalid, /""\r\n><#[] are not allowed",
|
|
|
+ * groups={"Profile", "Registration"}
|
|
|
+ * )
|
|
|
+ * @Assert\NotBlank(
|
|
|
+ * message="fos_user.username.blank",
|
|
|
+ * groups={"Profile", "Registration"}
|
|
|
+ * )
|
|
|
+ */
|
|
|
+ protected $username;
|
|
|
+
|
|
|
/**
|
|
|
* @ORM\ManyToMany(targetEntity="Package", mappedBy="maintainers")
|
|
|
*/
|