1 | <?php |
||
14 | class Metadata |
||
15 | { |
||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $class; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $alias; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $phpcrType; |
||
30 | |||
31 | /** |
||
32 | * @var \ReflectionClass |
||
33 | */ |
||
34 | private $reflection; |
||
35 | |||
36 | /** |
||
37 | * @var array |
||
38 | */ |
||
39 | private $fieldMappings; |
||
40 | |||
41 | /** |
||
42 | * Add a field mapping for field with given name, for example:. |
||
43 | * |
||
44 | * ```` |
||
45 | * $metadata->addFieldMapping(array( |
||
46 | * 'encoding' => 'content', |
||
47 | * 'property' => 'phpcr_property_name', |
||
48 | * )); |
||
49 | * ```` |
||
50 | * |
||
51 | * @param string $name Name of field/property in the mapped class. |
||
52 | * @param array $mapping { |
||
53 | * |
||
54 | * @var string Encoding type to use, @see \Sulu\Component\DocumentManager\PropertyEncoder::encode() |
||
55 | * @var string PHPCR property name (excluding the prefix) |
||
56 | * @var string Type of field (leave blank to determine automatically) |
||
57 | * @var bool If the field should be mapped. Set to false to manually persist and hydrate the data. |
||
58 | * } |
||
59 | */ |
||
60 | public function addFieldMapping($name, $mapping) |
||
73 | |||
74 | /** |
||
75 | * Return all field mappings. |
||
76 | * |
||
77 | * @return array |
||
78 | */ |
||
79 | public function getFieldMappings() |
||
83 | |||
84 | /** |
||
85 | * @return string |
||
86 | */ |
||
87 | public function getClass() |
||
91 | |||
92 | /** |
||
93 | * @param string $class |
||
94 | */ |
||
95 | public function setClass($class) |
||
100 | |||
101 | /** |
||
102 | * @return ReflectionClass |
||
103 | */ |
||
104 | public function getReflectionClass() |
||
120 | |||
121 | /** |
||
122 | * @return string |
||
123 | */ |
||
124 | public function getAlias() |
||
128 | |||
129 | /** |
||
130 | * @param string $alias |
||
131 | */ |
||
132 | public function setAlias($alias) |
||
136 | |||
137 | /** |
||
138 | * @return string |
||
139 | */ |
||
140 | public function getPhpcrType() |
||
144 | |||
145 | /** |
||
146 | * @param string $phpcrType |
||
147 | */ |
||
148 | public function setPhpcrType($phpcrType) |
||
152 | } |
||
153 |