1: <?php
2:
3: namespace Charcoal\Model;
4:
5: use \Traversable;
6:
7: // Local namespace dependency
8: use \Charcoal\Model\Service\MetadataLoader;
9:
10: /**
11: * Defines a model having metadata that allows the customization of objects.
12: */
13: interface DescribableInterface
14: {
15: /**
16: * @param array $data The object data.
17: * @return DescribableInterface Chainable
18: */
19: public function setData(array $data);
20:
21: /**
22: * @param MetadataLoader $loader The loader instance, used to load metadata.
23: * @return DescribableInterface Chainable
24: */
25: public function setMetadataLoader(MetadataLoader $loader);
26:
27: /**
28: * @param array|MetadataInterface $metadata The matadata.
29: * @return DescribableInterface Chainable
30: */
31: public function setMetadata($metadata);
32:
33: /**
34: * @return MetadataInterface
35: */
36: public function metadata();
37:
38: /**
39: * @param string $metadataIdent The metadata ident to load. If null, generate from object.
40: * @return MetadataInterface
41: */
42: public function loadMetadata($metadataIdent = null);
43:
44: /**
45: * @param string $metadataIdent Explicitely set the metadata ident.
46: * @return DescribableInterface Chainable
47: */
48: public function setMetadataIdent($metadataIdent);
49:
50: /**
51: * @return string
52: */
53: public function metadataIdent();
54: }
55: