Exemplo n.º 1
0
 public static function updateIndex($phid, $name)
 {
     $table = new ManiphestNameIndex();
     $conn_w = $table->establishConnection('w');
     queryfx($conn_w, 'INSERT INTO %T (indexedObjectPHID, indexedObjectName) VALUES (%s, %s)
     ON DUPLICATE KEY UPDATE indexedObjectName = VALUES(indexedObjectName)', $table->getTableName(), $phid, $name);
 }
 public function handleEvent(PhutilEvent $event)
 {
     $phid = $event->getValue('phid');
     $type = phid_get_type($phid);
     // For now, we only index projects.
     if ($type != PhabricatorProjectProjectPHIDType::TYPECONST) {
         return;
     }
     $document = $event->getValue('document');
     ManiphestNameIndex::updateIndex($phid, $document->getDocumentTitle());
 }
 public function indexFulltextObject($object, PhabricatorSearchAbstractDocument $document)
 {
     ManiphestNameIndex::updateIndex($object->getPHID(), $object->getName());
 }