PropertyModifierHook: provide the property name

fixes #2241
This commit is contained in:
Thomas Gelf 2020-12-02 17:59:15 +01:00
parent a2757f1376
commit c12cf5ddb3
3 changed files with 23 additions and 0 deletions

View File

@ -59,6 +59,7 @@ before switching to a new version.
* FEATURE: UTF8 validation for failed imports gives better error message (#2143)
* FEATURE: ArrayByElementPosition now allows filtering by key name (#1721)
* FEATURE: Use your Director Objects as an Import Source (#2198)
* FEATURE: Property modifiers are now granted access the current Property Name (#2241)
* FIX: Import Source preview now catches all errors
* FIX: Import Source download sends eventual errors as a valid JSON result
* FIX: LDAP Import is now able to paginate limited results (#2019)

View File

@ -13,6 +13,9 @@ abstract class PropertyModifierHook
/** @var string */
private $targetProperty;
/** @var string */
private $propertyName;
/** @var Db */
private $db;
@ -143,6 +146,24 @@ abstract class PropertyModifierHook
return $this;
}
/**
* @return string
*/
public function getPropertyName()
{
return $this->propertyName;
}
/**
* @param string $propertyName
* @return $this
*/
public function setPropertyName($propertyName)
{
$this->propertyName = $propertyName;
return $this;
}
/**
* The desired target property. Modifiers might want to have their outcome
* written to another property of the current row.

View File

@ -46,6 +46,7 @@ class ImportRowModifier extends DbObjectWithSettings
}
$obj = new $class;
$obj->setSettings($this->getSettings());
$obj->setPropertyName($this->get('property_name'));
$obj->setTargetProperty($this->get('target_property'));
$obj->setDb($this->connection);
$this->hookInstance = $obj;