I have a form with a whole lot of "inventory" items, my data looks like this:
$this->data['Inventory'][#]['description']
$this->data['Inventory'][#]['quantity']
$this->data['Inventory'][#]['category_id']
the thing is I don't know how to unset $this->data['Inventory'][#] if the quatity is either 0 or NULL. I can do this easily with a single record but what is the easiest way to do it with multiple records as above?
my instinct tells me to loop through $this->data in beforeSave() and unset whatever key with and array value with value of 0 or NULL for key 'quantity', is there a better way?