/** * Store a mapping between Segue1 ids and Segue2 ids * * @return void * @access protected * @since 3/20/08 */ protected function storeSegue1IdMapping() { if (!isset($this->origenSlotname)) { throw new OperationFailedException("Origen slot not set. Call " . get_class($this) . "->setOrigenSlotname('xxxxx')."); } if (!isset($this->destSlotname)) { throw new OperationFailedException("Destination slot not set. Call " . get_class($this) . "->setDestinationSlotname('xxxxx')."); } $dbc = Services::getService('DatabaseManager'); $map = $this->filterNonAccessible($this->getIdMap()); // printpre(htmlentities($this->doc->saveXMLWithWhitespace())); // printpre($map); // throw new Exception('test'); // Delete any old mappings $query = new DeleteQuery(); $query->setTable('segue1_id_map'); $query->addWhereIn('segue1_id', array_keys($map)); $dbc->query($query, IMPORTER_CONNECTION); // Add new mappings $query = new InsertQuery(); $query->setTable('segue1_id_map'); foreach ($map as $segue1Id => $segue2Id) { $query->createRow(); $query->addValue('segue1_slot_name', $this->origenSlotname); $query->addValue('segue1_id', $segue1Id); $query->addValue('segue2_slot_name', $this->destSlotname); $query->addValue('segue2_id', $segue2Id); } $dbc->query($query, IMPORTER_CONNECTION); }