<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* @bundles/LeadBundle/Form/Validator/Constraints/LeadListAccessValidator.php */
class __TwigTemplate_04757483b95f938322fa44f4760c204a extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 1
        echo "<?php

namespace Mautic\\LeadBundle\\Form\\Validator\\Constraints;

use Mautic\\LeadBundle\\Model\\ListModel;
use Symfony\\Component\\Validator\\Constraint;
use Symfony\\Component\\Validator\\ConstraintValidator;

class LeadListAccessValidator extends ConstraintValidator
{
    /**
     * @var ListModel
     */
    private \$segmentModel;

    public function __construct(ListModel \$segmentModel)
    {
        \$this->segmentModel = \$segmentModel;
    }

    /**
     * @param mixed \$value
     */
    public function validate(\$value, Constraint \$constraint)
    {
        if (count(\$value)) {
            \$lists = \$this->segmentModel->getUserLists();
            foreach (\$value as \$l) {
                if (!isset(\$lists[\$l->getId()])) {
                    \$this->context->addViolation(
                        \$constraint->message,
                        ['%string%' => \$l->getName()]
                    );
                    break;
                }
            }
        } else {
            \$this->context->addViolation(\$constraint->message);
        }
    }
}
";
    }

    public function getTemplateName()
    {
        return "@bundles/LeadBundle/Form/Validator/Constraints/LeadListAccessValidator.php";
    }

    public function getDebugInfo()
    {
        return array (  37 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "@bundles/LeadBundle/Form/Validator/Constraints/LeadListAccessValidator.php", "/var/www/mautic/app/bundles/LeadBundle/Form/Validator/Constraints/LeadListAccessValidator.php");
    }
}
