public function map($handler) { $result = array(); foreach ($this as $id => $document) { $result[$id] = $handler($document); } return $result; }