I am trying to save catalog rule condtions from my custom module, below is the array I get in my controller save.php
[rule] => Array
(
[conditions] => Array
(
[1] => Array
(
[type] => Magento\CatalogRule\Model\Rule\Condition\Combine
[aggregator] => all
[value] => 1
[new_child] =>
)
[1--1] => Array
(
[type] => Magento\CatalogRule\Model\Rule\Condition\Product
[attribute] => attribute_set_id
[operator] => ==
[value] => 4
)
)
)
The array is further modified to conditions by doing:
if (isset($data['rule'])) {
$data['conditions'] = $data['rule']['conditions'];
unset($data['rule']);
}
My database table column for conditions is conditions_serialized as it is in catalogrule table. Now my question is what are the steps I am missing in between -- because when I save a record I get the error:
Something went wrong while saving the record !
Any one who has implemented this might be having a better insight in to the problem , please advise .