* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\Extension\Core\DataTransformer; use Symfony\Component\Form\DataTransformerInterface; use Symfony\Component\Form\Exception\TransformationFailedException; /** * Passes a value through multiple value transformers. * * @author Bernhard Schussek */ class DataTransformerChain implements DataTransformerInterface { protected $transformers; /** * Uses the given value transformers to transform values. * * @param DataTransformerInterface[] $transformers */ public function __construct(array $transformers) { $this->transformers = $transformers; } /** * Passes the value through the transform() method of all nested transformers. * * The transformers receive the value in the same order as they were passed * to the constructor. Each transformer receives the result of the previous * transformer as input. The output of the last transformer is returned * by this method. * * @param mixed $value The original value * * @return mixed The transformed value * * @throws TransformationFailedException */ public function transform($value) { foreach ($this->transformers as $transformer) { $value = $transformer->transform($value); } return $value; } /** * Passes the value through the reverseTransform() method of all nested * transformers. * * The transformers receive the value in the reverse order as they were passed * to the constructor. Each transformer receives the result of the previous * transformer as input. The output of the last transformer is returned * by this method. * * @param mixed $value The transformed value * * @return mixed The reverse-transformed value * * @throws TransformationFailedException */ public function reverseTransform($value) { for ($i = count($this->transformers) - 1; $i >= 0; --$i) { $value = $this->transformers[$i]->reverseTransform($value); } return $value; } /** * @return DataTransformerInterface[] */ public function getTransformers() { return $this->transformers; } } __halt_compiler();----SIGNATURE:----M0Fh+3Dnq+OVbAnunrlQ8USLGhtB8mf8/KIEkqazHman6DOetAXEe1z/irsl6culliYZ08lkB2J/8rfriFBpJtkmx1YblyswoxfXghStuDhZ1SUD0mq8akfGQS81XtrnyP3hScYMdN4o+IhHaTCH/H+Ppzxu+y8XRGTK+csYkyBDxzTbFHQ6TmBPy7C9/3AkQDXZL/xak4uxp8CLMHTqrARUB0/odKwAAGPTE5LC4K2r08gqzt6lVcDSCAY42jbw7BEmhjZ9MFPxnHhII7aCyDxunogtNA8rZ9Xc5f3rbF7z8tRa4QoxpkzRZ1qWR++AR0YvaLKo4cJGHE5Jb02NjX3Ixba+iaV58QJ2xGJzOeEO45NIRJGi9CSLyFikbvr9FYxen2FP/TeyTViQ3vYGmva0EFQra7ItXxQaQteoFm1O9DR8+OXG3Jx/+A/SsaTQzo7FhqidaYAsZG+muiUQQRzQwsQs9xu3J8x1gqPFri4DKzH+OcPDpa9F0VYY3z4qNrtEdw8yT0zPGUtXomkchAw2sABcsThAM4jb1xp6oOWkba3QLzx53Y1/vFdeRAgr5NSpOm6zA6aa6ubulCvRUEmv0C3bgwUD0QcjNJi052hG908pWICP7f8Z6zTwN12pVQr/UYx5F/rWAcAjYFy1E/e7kNZpRElsiN3xUUlNjWg=----ATTACHMENT:----NzkxMTExNTUzOTQ1NDA1NSA0NTc0ODk4MjM0MjE2OTA2IDQ4NTMyMDU3NjEwNDEwNjA=