. /** * Mapper class * * it will store the ( type, old, new ) triplet for later retrieval */ class ImportXml_Mapper { private $issue = array( ); public function add( $type, $old, $new ) { $this->{$type}[ $old ] = $new; } public function exists( $type, $id ) { return array_key_exists( $id, $this->{$type} ); } public function getNewID( $type, $old ) { if( $this->exists( $type, $old ) ) { return $this->{$type}[ $old ]; } else { return $old; } } public function getAll( $type ) { return $this->{$type}; } }