<?php
/**
 * @author Colinet Julien
 */

namespace CpCreation\VitiCore\Bridge\Symfony\Bundle\Form\Admin\DataTransformer;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Form\DataTransformerInterface;

class TransformCounties implements DataTransformerInterface
{
    public function transform($value)
    {
        if ($value instanceof Collection){
            return $value->toArray();
        }

        return $value;
    }

    public function reverseTransform($value)
    {

        return $value;
    }
}
