1: <?php
2:
3: namespace Charcoal\Model;
4:
5: // Module `charcoal-property` dependencies
6: use \Charcoal\Property\PropertyInterface;
7:
8: // Module `charcoal-config` depeendencies
9: use \Charcoal\Config\ConfigInterface;
10:
11: /**
12: * Defines a metadata container.
13: *
14: * Metadata is typically used to describe an object.
15: */
16: interface MetadataInterface extends ConfigInterface
17: {
18: /**
19: * Set the object's default values.
20: *
21: * @param array $defaultData An associative array.
22: * @return MetadataInterface Chainable
23: */
24: public function setDefaultData(array $defaultData);
25:
26: /**
27: * Retrieve the default values.
28: *
29: * @return array
30: */
31: public function defaultData();
32:
33: /**
34: * Retrieve the properties.
35: *
36: * @return array
37: */
38: public function properties();
39:
40: /**
41: * Retrieve the given property.
42: *
43: * @param string $propertyIdent The property identifier.
44: * @return array|null
45: */
46: public function property($propertyIdent);
47:
48: /**
49: * Assign an instance of {@see PropertyInterface} to the given property.
50: *
51: * @param string $propertyIdent The property indentifer.
52: * @param PropertyInterface $propertyObject The property, as object.
53: * @return MetadataInterface Chainable
54: */
55: public function setPropertyObject($propertyIdent, PropertyInterface $propertyObject);
56:
57: /**
58: * Retrieve the given property as an object.
59: *
60: * @param string $propertyIdent The property (identifier) to return, as an object.
61: * @return PropertyInterface|null
62: */
63: public function propertyObject($propertyIdent);
64: }
65: