PropertyModifierHook: allow modifiers to deal...

...with arrays

refs #12236
This commit is contained in:
Thomas Gelf 2016-08-30 07:53:10 +00:00
parent a64e36b111
commit a4813e8046
2 changed files with 6 additions and 1 deletions

View File

@ -28,6 +28,11 @@ abstract class PropertyModifierHook
return $class; return $class;
} }
public function hasArraySupport()
{
return false;
}
public function setTargetProperty($property) public function setTargetProperty($property)
{ {
$this->targetProperty = $property; $this->targetProperty = $property;

View File

@ -102,7 +102,7 @@ class ImportSource extends DbObjectWithSettings
$target = $mod->getTargetProperty($key); $target = $mod->getTargetProperty($key);
if (is_array($row->$key)) { if (is_array($row->$key) && ! $mod->hasArraySupport()) {
$new = array(); $new = array();
foreach ($row->$key as $k => $v) { foreach ($row->$key as $k => $v) {
$new[$k] = $mod->transform($v); $new[$k] = $mod->transform($v);