public function saveAll($data) { $collection = array(); foreach ($data as $index => $row) { $collection[$index] = R::dispense($this->name); foreach ($row as $name => $value) { $collection[$index]->{$name} = $value; } } R::storeAll($collection); }