public function __construct(PhabricatorSystemAction $action, $score) { $this->action = $action; $this->score = $score; parent::__construct($action->getLimitExplanation()); }
private static function recordAction(array $actors, PhabricatorSystemAction $action, $score) { $log = new PhabricatorSystemActionLog(); $conn_w = $log->establishConnection('w'); $sql = array(); foreach ($actors as $actor) { $sql[] = qsprintf($conn_w, '(%s, %s, %s, %f, %d)', PhabricatorHash::digestForIndex($actor), $actor, $action->getActionConstant(), $score, time()); } foreach (PhabricatorLiskDAO::chunkSQL($sql) as $chunk) { queryfx($conn_w, 'INSERT INTO %T (actorHash, actorIdentity, action, score, epoch) VALUES %Q', $log->getTableName(), $chunk); } }