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 normalizable.
|
Chris@0
|
16 *
|
Chris@0
|
17 * If a normalizer is registered for the class and it doesn't implement
|
Chris@0
|
18 * the Normalizable 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 NormalizableInterface
|
Chris@0
|
23 {
|
Chris@0
|
24 /**
|
Chris@0
|
25 * Normalizes the object into an array of scalars|arrays.
|
Chris@0
|
26 *
|
Chris@0
|
27 * It is important to understand that the normalize() call should normalize
|
Chris@0
|
28 * recursively all child objects of the implementor.
|
Chris@0
|
29 *
|
Chris@0
|
30 * @param NormalizerInterface $normalizer The normalizer is given so that you
|
Chris@0
|
31 * can use it to normalize objects contained within this object.
|
Chris@0
|
32 * @param string|null $format The format is optionally given to be able to normalize differently
|
Chris@0
|
33 * based on different output formats.
|
Chris@0
|
34 * @param array $context Options for normalizing this object
|
Chris@0
|
35 *
|
Chris@0
|
36 * @return array|scalar
|
Chris@0
|
37 */
|
Chris@0
|
38 public function normalize(NormalizerInterface $normalizer, $format = null, array $context = array());
|
Chris@0
|
39 }
|