<?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/Model/SegmentActionModel.php */
class __TwigTemplate_ad93c086875ee90bfb94219c823102ab 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\\Model;

class SegmentActionModel
{
    /**
     * @var LeadModel
     */
    private \$contactModel;

    public function __construct(LeadModel \$contactModel)
    {
        \$this->contactModel = \$contactModel;
    }

    public function addContacts(array \$contactIds, array \$segmentIds)
    {
        \$contacts = \$this->contactModel->getLeadsByIds(\$contactIds);

        foreach (\$contacts as \$contact) {
            if (!\$this->contactModel->canEditContact(\$contact)) {
                continue;
            }

            \$this->contactModel->addToLists(\$contact, \$segmentIds);
        }

        \$this->contactModel->saveEntities(\$contacts);
    }

    public function removeContacts(array \$contactIds, array \$segmentIds)
    {
        \$contacts = \$this->contactModel->getLeadsByIds(\$contactIds);

        foreach (\$contacts as \$contact) {
            if (!\$this->contactModel->canEditContact(\$contact)) {
                continue;
            }

            \$this->contactModel->removeFromLists(\$contact, \$segmentIds);
        }

        \$this->contactModel->saveEntities(\$contacts);
    }
}
";
    }

    public function getTemplateName()
    {
        return "@bundles/LeadBundle/Model/SegmentActionModel.php";
    }

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

    public function getSourceContext()
    {
        return new Source("", "@bundles/LeadBundle/Model/SegmentActionModel.php", "/var/www/mautic/app/bundles/LeadBundle/Model/SegmentActionModel.php");
    }
}
