|
@@ 85-96 (lines=12) @@
|
| 82 |
|
/** |
| 83 |
|
* @param LifecycleEventArgs $args |
| 84 |
|
*/ |
| 85 |
|
public function postLoad(LifecycleEventArgs $args) |
| 86 |
|
{ |
| 87 |
|
$entity = $this->getObjectFromLifeCycleArgs($args); |
| 88 |
|
$om = $this->getOmFromLifeCycleArgs($args); |
| 89 |
|
|
| 90 |
|
$properties = $this->getLdapObjectAnnotationProperties($entity, $om); |
| 91 |
|
foreach ($properties as $info) { |
| 92 |
|
if ($info['property']->getValue($entity)) { |
| 93 |
|
$this->setLdapObjectForProperty($info['property'], $info['annotation'], $entity); |
| 94 |
|
} |
| 95 |
|
} |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
/** |
| 99 |
|
* Handles transforming the value as it currently is to the value the DB expects. |
|
@@ 103-114 (lines=12) @@
|
| 100 |
|
* |
| 101 |
|
* @param LifecycleEventArgs $args |
| 102 |
|
*/ |
| 103 |
|
protected function transformValueForDb(LifecycleEventArgs $args) |
| 104 |
|
{ |
| 105 |
|
$entity = $this->getObjectFromLifeCycleArgs($args); |
| 106 |
|
$om = $this->getOmFromLifeCycleArgs($args); |
| 107 |
|
|
| 108 |
|
$properties = $this->getLdapObjectAnnotationProperties($entity, $om); |
| 109 |
|
foreach ($properties as $info) { |
| 110 |
|
if ($info['property']->getValue($entity)) { |
| 111 |
|
$this->setLdapValueForProperty($info['property'], $info['annotation'], $entity); |
| 112 |
|
} |
| 113 |
|
} |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
/** |
| 117 |
|
* Get all the properties from the entity that have a LdapObject annotation defined. |