[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/resources/sql/patches/ -> 20130802.heraldphids.php (source)

   1  <?php
   2  
   3  $table = new HeraldRule();
   4  $conn_w = $table->establishConnection('w');
   5  
   6  echo "Assigning PHIDs to Herald Rules...\n";
   7  
   8  foreach (new LiskMigrationIterator(new HeraldRule()) as $rule) {
   9    $id = $rule->getID();
  10    echo "Rule {$id}.\n";
  11  
  12    if ($rule->getPHID()) {
  13      continue;
  14    }
  15  
  16    queryfx(
  17      $conn_w,
  18      'UPDATE %T SET phid = %s WHERE id = %d',
  19      $table->getTableName(),
  20      PhabricatorPHID::generateNewPHID(HeraldRulePHIDType::TYPECONST),
  21      $rule->getID());
  22  }
  23  
  24  echo "Done.\n";


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1