0
我想定義與註釋電子郵件驗證,這樣如何在Doctrine 2 ODM中設置symfony /驗證器?
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ODM\Document(collection="dummies")
*/
class Dummy
{
/** @ODM\Id */
private $id;
/** @ODM\String @Assert\Email() */
private $email;
}