使用Validator我有这个错误
[语义错误]注释" @Symfony \ Component \ Validator \ Constraints \ MinLength"属性My \ testBundle \ Entity \ Desk :: $ title不存在,或者无法自动加载。
namespace My\testBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Desk
*
* @ORM\Table(name="desk")
* @ORM\Entity(repositoryClass="My\testBundle\Repository\DeskRepository")
*/
class Desk
{
/**
* @ORM\OneToMany(targetEntity="DeskComment", mappedBy="desk", cascade={"remove", "persist"})
*/
protected $comments;
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
*
* @ORM\Column(name="title", type="string", length=255)
* @Assert\NotBlank()
* @Assert\MinLength(
* limit=3,
* message="Your name must have at least {{ limit }} characters."
* )
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="symmary", type="text")
*/
private $symmary;
/**
* @var string
*
* @ORM\Column(name="description", type="text")
*/
private $description;
/**
* @var string
*
* @ORM\Column(name="note", type="decimal", nullable=true)
*/
private $note;
问题是@Assert\MinLength
。
任何帮助?