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\Mapping\Factory;
|
Chris@0
|
13
|
Chris@0
|
14 use Symfony\Component\Serializer\Exception\InvalidArgumentException;
|
Chris@0
|
15 use Symfony\Component\Serializer\Mapping\ClassMetadataInterface;
|
Chris@0
|
16
|
Chris@0
|
17 /**
|
Chris@0
|
18 * Returns a {@see ClassMetadataInterface}.
|
Chris@0
|
19 *
|
Chris@0
|
20 * @author Kévin Dunglas <dunglas@gmail.com>
|
Chris@0
|
21 */
|
Chris@0
|
22 interface ClassMetadataFactoryInterface
|
Chris@0
|
23 {
|
Chris@0
|
24 /**
|
Chris@0
|
25 * If the method was called with the same class name (or an object of that
|
Chris@0
|
26 * class) before, the same metadata instance is returned.
|
Chris@0
|
27 *
|
Chris@0
|
28 * If the factory was configured with a cache, this method will first look
|
Chris@0
|
29 * for an existing metadata instance in the cache. If an existing instance
|
Chris@0
|
30 * is found, it will be returned without further ado.
|
Chris@0
|
31 *
|
Chris@0
|
32 * Otherwise, a new metadata instance is created. If the factory was
|
Chris@0
|
33 * configured with a loader, the metadata is passed to the
|
Chris@0
|
34 * {@link \Symfony\Component\Serializer\Mapping\Loader\LoaderInterface::loadClassMetadata()} method for further
|
Chris@0
|
35 * configuration. At last, the new object is returned.
|
Chris@0
|
36 *
|
Chris@0
|
37 * @param string|object $value
|
Chris@0
|
38 *
|
Chris@0
|
39 * @return ClassMetadataInterface
|
Chris@0
|
40 *
|
Chris@0
|
41 * @throws InvalidArgumentException
|
Chris@0
|
42 */
|
Chris@0
|
43 public function getMetadataFor($value);
|
Chris@0
|
44
|
Chris@0
|
45 /**
|
Chris@0
|
46 * Checks if class has metadata.
|
Chris@0
|
47 *
|
Chris@0
|
48 * @param mixed $value
|
Chris@0
|
49 *
|
Chris@0
|
50 * @return bool
|
Chris@0
|
51 */
|
Chris@0
|
52 public function hasMetadataFor($value);
|
Chris@0
|
53 }
|