Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 /*
|
Chris@0
|
4 * This file is part of the Symfony package.
|
Chris@0
|
5 *
|
Chris@0
|
6 * (c) Fabien Potencier <fabien@symfony.com>
|
Chris@0
|
7 *
|
Chris@0
|
8 * For the full copyright and license information, please view the LICENSE
|
Chris@0
|
9 * file that was distributed with this source code.
|
Chris@0
|
10 */
|
Chris@0
|
11
|
Chris@0
|
12 namespace Symfony\Component\Serializer\Normalizer;
|
Chris@0
|
13
|
Chris@0
|
14 /**
|
Chris@0
|
15 * Defines the most basic interface a class must implement to be denormalizable.
|
Chris@0
|
16 *
|
Chris@0
|
17 * If a denormalizer is registered for the class and it doesn't implement
|
Chris@0
|
18 * the Denormalizable interfaces, the normalizer will be used instead
|
Chris@0
|
19 *
|
Chris@0
|
20 * @author Jordi Boggiano <j.boggiano@seld.be>
|
Chris@0
|
21 */
|
Chris@0
|
22 interface DenormalizableInterface
|
Chris@0
|
23 {
|
Chris@0
|
24 /**
|
Chris@0
|
25 * Denormalizes the object back from an array of scalars|arrays.
|
Chris@0
|
26 *
|
Chris@0
|
27 * It is important to understand that the denormalize() call should denormalize
|
Chris@0
|
28 * recursively all child objects of the implementor.
|
Chris@0
|
29 *
|
Chris@14
|
30 * @param DenormalizerInterface $denormalizer The denormalizer is given so that you
|
Chris@14
|
31 * can use it to denormalize objects contained within this object
|
Chris@14
|
32 * @param array|string|int|float|bool $data The data from which to re-create the object
|
Chris@14
|
33 * @param string|null $format The format is optionally given to be able to denormalize
|
Chris@14
|
34 * differently based on different input formats
|
Chris@14
|
35 * @param array $context Options for denormalizing
|
Chris@0
|
36 *
|
Chris@0
|
37 * @return object
|
Chris@0
|
38 */
|
Chris@17
|
39 public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null, array $context = []);
|
Chris@0
|
40 }
|