Using Doctrine PHPCR-ODM, is there a way to apply a constraint on a property to prevent duplicate values on the same document type ?
For example (getter and setter have been intentionally omitted):
namespace App\Document;
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
/**
* @PHPCRODM\Document
*/
class Article
{
/**
* @PHPCRODM\Field(type="string")
*/
protected $title;
}
Is there a way to make the title
field unique on all the Article
documents ?