<?xml version="1.0" ?>

<!--
 This file is part of the FOSCommentBundle package.

 (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>

 This source file is subject to the MIT license that is bundled
 with this source code in the file LICENSE.
-->

<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="FOS\CommentBundle\Model\Comment">

        <property name="body">
            <constraint name="NotBlank">
                <option name="message">Please enter a message</option>
            </constraint>
            <constraint name="Length">
                <option name="min">3</option>
                <option name="minMessage">The message is too short|The message is too short</option>
            </constraint>
        </property>
    </class>

    <class name="FOS\CommentBundle\Model\Vote">
        <constraint name="Callback">isVoteValid</constraint>
    </class>

    <class name="FOS\CommentBundle\Model\Thread">

        <property name="id">
            <constraint name="NotBlank">
                <option name="message">Please enter an id</option>
                <option name="groups">
                    <value>NewThread</value>
                </option>
            </constraint>
        </property>

        <property name="permalink">
            <constraint name="NotBlank">
                <option name="message">Please enter a permalink</option>
                <option name="groups">
                    <value>NewThread</value>
                </option>
            </constraint>
            <constraint name="Url">
                <option name="message">Please provide a valid url</option>
                <option name="groups">
                    <value>NewThread</value>
                </option>
            </constraint>
        </property>
    </class>

</constraint-mapping>
