<?php
/**
 * ValidExpression Constraint
 *
 * @author Elze Kool <info@visualmedia.nl>
 */

namespace VisualM\TagManagerBundle\Validator\Constraints;

use Symfony\Component\Validator\Constraint;

/**
 * ValidExpression Constraint
 *
 * @Annotation
 * 
 * @author Elze Kool <info@visualmedia.nl>
 */
class ValidExpression extends Constraint
{
    /**
     * Message
     * @var string
     */
    public $message = 'Error in expression (%expr_error%)';

    /**
     * Function to get value (expression)
     * @var string
     */
    public $valueFunc = null;

    /**
     * Function to check if validation should check expression
     * @var string
     */
    public $enabledFunc = null;

    /**
     * Target field for validation message
     * @var string
     */
    public $target = null;
    
    /**
     * {@inheritDoc}
     */
    public function validatedBy()
    {
        return 'visualm.tag_manager.validator.valid_expression';
    }

    /**
     * {@inheritDoc}
     */
    public function getTargets()
    {
        return self::CLASS_CONSTRAINT;
    }
}
