Skip to content

Instantly share code, notes, and snippets.

@mishanon
Created April 4, 2016 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mishanon/f29e893053e5cdd36871c3808248e10a to your computer and use it in GitHub Desktop.
Save mishanon/f29e893053e5cdd36871c3808248e10a to your computer and use it in GitHub Desktop.
arrayOfElementsOrElementApplyMethod($value, function($value, $validator, $logFiltered) {
if ($validator->isValid($value) === false) {
if ($logFiltered) {
// create a log item
$logItem = new ProductFilteredItem($testObject->getAggregateRoot());
$logItem->setActorId($actorId);
$logItem->setProductContainerId($testObject->getProductId());
$logItem->setAddedOn(new \Core\Domain\LendoDateTime());
$logItem->setFilterId($validator->getFilterId());
$logItem->setFilteredValue((string)$value);
$testObject->getProductFilteredLog()->addItem($logItem);
return false;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment