public function __clone() { foreach ($this->batches as $i => $batch) { $this->batches[$i] = clone $batch; } }