Path: blob/master/src/applications/maniphest/storage/ManiphestNameIndex.php
12256 views
<?php12/**3* Denormalizes object names to support queries which need to be ordered or4* grouped by things like projects.5*/6final class ManiphestNameIndex extends ManiphestDAO {78protected $indexedObjectPHID;9protected $indexedObjectName;1011protected function getConfiguration() {12return array(13self::CONFIG_TIMESTAMPS => false,14self::CONFIG_COLUMN_SCHEMA => array(15'indexedObjectName' => 'sort128',16),17self::CONFIG_KEY_SCHEMA => array(18'key_phid' => array(19'columns' => array('indexedObjectPHID'),20'unique' => true,21),22'key_name' => array(23'columns' => array('indexedObjectName'),24),25),26) + parent::getConfiguration();27}2829public static function updateIndex($phid, $name) {30$table = new ManiphestNameIndex();31$conn_w = $table->establishConnection('w');32queryfx(33$conn_w,34'INSERT INTO %T (indexedObjectPHID, indexedObjectName) VALUES (%s, %s)35ON DUPLICATE KEY UPDATE indexedObjectName = VALUES(indexedObjectName)',36$table->getTableName(),37$phid,38$name);39}4041}424344