public function loadArray($arr, $key = 'conditions')
{
$aggregator = $this->getAggregatorFromArray($arr);
$value = $this->getValueFromArray($arr);
$this->setAggregator($aggregator)->setValue($value);
if (!empty($arr[$key]) && is_array($arr[$key])) {
foreach ($arr[$key] as $conditionArr) {
try {
$condition = $this->_conditionFactory->create($conditionArr['type']);
$condition->setElementName($this->elementName);
$condition->setRule($this->getRule());
$this->addCondition($condition);
$condition->loadArray($conditionArr, $key);
} catch (\Exception $e) {
$this->_logger->critical($e);
}
}
}
return $this;
}