protected function loadPage() { $table = new PhabricatorCountdown(); $conn_r = $table->establishConnection('r'); $data = queryfx_all($conn_r, 'SELECT * FROM %T %Q %Q %Q', $table->getTableName(), $this->buildWhereClause($conn_r), $this->buildOrderClause($conn_r), $this->buildLimitClause($conn_r)); $countdowns = $table->loadAllFromArray($data); return $countdowns; }
<?php $table = new PhabricatorCountdown(); $conn_w = $table->establishConnection('w'); $iterator = new LiskMigrationIterator($table); foreach ($iterator as $countdown) { $id = $countdown->getID(); echo pht('Adding mail key for countdown %d...', $id); echo "\n"; queryfx($conn_w, 'UPDATE %T SET mailKey = %s WHERE id = %d', $table->getTableName(), Filesystem::readRandomCharacters(20), $id); }