protected function loadPage() { $table = new PhabricatorTokenGiven(); $conn_r = $table->establishConnection('r'); $rows = queryfx_all($conn_r, 'SELECT * FROM %T %Q %Q %Q', $table->getTableName(), $this->buildWhereClause($conn_r), $this->buildOrderClause($conn_r), $this->buildLimitClause($conn_r)); return $table->loadAllFromArray($rows); }
private function executeDeleteToken(PhabricatorTokenReceiverInterface $object, PhabricatorTokenGiven $token_given) { $token_given->openTransaction(); $token_given->delete(); queryfx($token_given->establishConnection('w'), 'INSERT INTO %T (objectPHID, tokenCount) VALUES (%s, 0) ON DUPLICATE KEY UPDATE tokenCount = tokenCount - 1', id(new PhabricatorTokenCount())->getTableName(), $object->getPHID()); $token_given->saveTransaction(); }