<?php
namespace Newland\Toubiz\Sync\Neos\Domain\Filter;

/*
 * This file is part of the "toubiz-sync-neos" package.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 */

use Newland\Toubiz\Sync\Neos\Domain\Model\Region;

/**
 * Transportation facility filter class.
 */
class TransportationFacilityFilter extends AbstractFilter
{
    /**
     * @var Region[]
     */
    protected $regions;

    /**
     * @var int[]
     */
    protected $types = [];

    /**
     * @param array $regions
     * @return void
     */
    public function setRegions(array $regions)
    {
        $this->regions = $regions;
    }

    /**
     * @return array
     */
    public function getRegions()
    {
        return $this->regions;
    }

    /**
     * @param mixed $regions
     * @return self
     */
    public function setRegionCollection($regions)
    {
        $this->regions = [];
        foreach ($regions as $region) {
            $this->regions[] = $region->getPersistenceObjectIdentifier();
        }
        return $this;
    }

    /**
     * @param array $types
     * @return void
     */
    public function setTypes($types)
    {
        $this->types = $types;
    }

    /**
     * @return array
     */
    public function getTypes()
    {
        return $this->types;
    }
}
