public function attachAtom(DivinerLiveAtom $atom = null)
 {
     if ($atom === null) {
         $this->atom = null;
     } else {
         $this->atom = DivinerAtom::newFromDictionary($atom->getAtomData());
     }
     return $this;
 }
 protected function deleteDocumentsByHash(array $hashes)
 {
     $atom_table = new DivinerLiveAtom();
     $symbol_table = new DivinerLiveSymbol();
     $conn_w = $symbol_table->establishConnection('w');
     $strings = array();
     foreach ($hashes as $hash) {
         $strings[] = qsprintf($conn_w, '%s', $hash);
     }
     foreach (PhabricatorLiskDAO::chunkSQL($strings, ', ') as $chunk) {
         queryfx($conn_w, 'UPDATE %T SET graphHash = NULL, nodeHash = NULL
       WHERE graphHash IN (%Q)', $symbol_table->getTableName(), $chunk);
     }
     queryfx($conn_w, 'DELETE a FROM %T a LEFT JOIN %T s
     ON a.symbolPHID = s.phid
     WHERE s.graphHash IS NULL', $atom_table->getTableName(), $symbol_table->getTableName());
 }
Esempio n. 3
0
 public function attachAtom(DivinerLiveAtom $atom)
 {
     $this->atom = DivinerAtom::newFromDictionary($atom->getAtomData());
     return $this;
 }