/** * 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); }
/** * Delete implicit Authorizations on an array of NodeIds that were caused by any * of an array of explict authorizations * * @param array $explicitAZs An array of Authorization objects * @param array $nodeIds An array of Id objects * @return void * @access protected * @since 4/21/08 */ protected function deleteImplicitAZs(array $explicitAZs, array $nodeIds) { if (!count($explicitAZs)) { return; } if (!count($nodeIds)) { return; } $explicitAZIdStrings = array(); foreach ($explicitAZs as $az) { $explicitAZIdStrings[] = $az->getIdString(); } $nodeIdStrings = array(); foreach ($nodeIds as $id) { $nodeIdStrings[] = $id->getIdString(); } $query = new DeleteQuery(); $query->setTable("az2_implicit_az"); $query->addWhereIn("fk_explicit_az", $explicitAZIdStrings); $query->addWhereIn("fk_qualifier", $nodeIdStrings); $dbHandler = Services::getService("DatabaseManager"); $dbHandler->query($query, $this->_dbIndex); }