src/Mapper/Definition/ConfigurationProcessor/AttributeProcessor.php 1 location
|
@@ 24-38 (lines=15) @@
|
21 |
|
/** |
22 |
|
* {@inheritdoc} |
23 |
|
*/ |
24 |
|
public function process(array $config, Definition $definition) |
25 |
|
{ |
26 |
|
if (! isset($config['attributes'])) { |
27 |
|
return; |
28 |
|
} |
29 |
|
|
30 |
|
$reflection = new \ReflectionClass($definition->getClass()); |
31 |
|
|
32 |
|
foreach ($config['attributes'] as $name => $data) |
33 |
|
{ |
34 |
|
$attribute = $this->createAttribute($reflection, $name, $data); |
35 |
|
|
36 |
|
$definition->addAttribute($attribute); |
37 |
|
} |
38 |
|
} |
39 |
|
|
40 |
|
/** |
41 |
|
* Create attribute |
src/Mapper/Definition/ConfigurationProcessor/RelationshipProcessor.php 1 location
|
@@ 19-33 (lines=15) @@
|
16 |
|
/** |
17 |
|
* {@inheritdoc} |
18 |
|
*/ |
19 |
|
public function process(array $config, Definition $definition) |
20 |
|
{ |
21 |
|
if (! isset($config['relationships'])) { |
22 |
|
return; |
23 |
|
} |
24 |
|
|
25 |
|
$reflection = new \ReflectionClass($definition->getClass()); |
26 |
|
|
27 |
|
foreach ($config['relationships'] as $name => $data) |
28 |
|
{ |
29 |
|
$relationship = $this->createRelationship($reflection, $name, $data); |
30 |
|
|
31 |
|
$definition->addRelationship($relationship); |
32 |
|
} |
33 |
|
} |
34 |
|
|
35 |
|
/** |
36 |
|
* Process relationship |