private function convertXerxesRecord(Xerxes_Record $xerxes) { $citation = new Xerxes_Citation_Data(); $map = array("type" => "format", "issued" => "year", "number" => "", "number_of_volumes" => "", "publisher_place" => "place", "event" => "", "event_place" => "", "page" => "startPage", "locator" => "", "genre" => "format"); foreach ($citation as $key => $value) { if ($key == "names") { foreach ($xerxes->getAuthors() as $author) { $name = new Xerxes_Citation_Name(); foreach ($author as $key => $value) { $name->{$key} = $value; } array_push($citation->names, $name); } } $target = $key; if (array_key_exists($key, $map)) { $target = $map[$key]; } $method = Xerxes_Framework_Parser::strtoupper(substr($target, 0, 1)); $method .= substr($target, 1); $method = "get{$method}"; if (method_exists($xerxes, $method)) { $citation->{$key} = $xerxes->{$method}(); } } print_r($citation); }