-
Create a model from an array with $m = new Model(new Array_($t)); where $t= [ ['name' => 'January', 'sales' => 20000, 'purchases' => 10000], ['name' => 'February', 'sales' => 23000, 'purchases' => 12000]]
-
Iterate through model with foreach ($model as $row) { }
Atk4\Data throws an error on iteration as it does not accept id to be zero in \Atk4\Data\Field Line 311.
$value = (int) $value; if ($this->required && empty($value)) { throw new ValidationException([$this->name => 'Must not be a zero'], $this->getOwner()); }
@mvorisek Probably due to stricter type validation, but that way Persistence\Array_ is broken.