Skip to content

Instantly share code, notes, and snippets.

@rande
Created May 23, 2011 21:08
Show Gist options
  • Save rande/987612 to your computer and use it in GitHub Desktop.
Save rande/987612 to your computer and use it in GitHub Desktop.
<?xml version="1.0" ?>
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping
http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Application\Sonata\NewsBundle\Entity\Post">
<getter property="title">
<constraint name="NotBlank" />
<constraint name="NotNull" />
</getter>
<getter property="abstract">
<constraint name="NotNull" />
<constraint name="NotBlank" />
</getter>
<getter property="author">
<constraint name="Valid" />
</getter>
<getter property="content">
<constraint name="NotNull" />
<constraint name="NotBlank"/>
</getter>
<getter property="tags">
<constraint name="Valid" />
</getter>
</class>
<class name="Application\Sonata\NewsBundle\Entity\Comment">
<getter property="name">
<constraint name="NotBlank" />
<constraint name="NotNull" />
</getter>
<getter property="email">
<constraint name="NotNull" />
<constraint name="NotBlank" />
<constraint name="Email" />
</getter>
<getter property="url">
<constraint name="Url" />
</getter>
<getter property="message">
<constraint name="NotNull" />
<constraint name="NotBlank" />
</getter>
<!--<getter property="post">-->
<!--<constraint name="Valid" />-->
<!--</getter>-->
</class>
<class name="Application\Sonata\NewsBundle\Entity\Tag">
<getter property="name">
<constraint name="NotBlank" />
<constraint name="NotNull" />
</getter>
</class>
</constraint-mapping>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment