link_lookup->find_where( self::FIXABLE_CONDITION, $link_id, Outcome::Listed->value, $fix_id ); } public function mark( int $link_id, int $fix_id, Outcome $outcome, string|null $redirect_to ): void { $this->query_runner->update( $this->tables->links(), array( 'outcome' => $outcome->value, 'fixed_by' => $fix_id, 'redirect_to' => $redirect_to, ), array( 'id' => $link_id ) ); } public function revert( int $fix_id, int $limit ): int { $rows = $this->query_runner->rows( $this->query_runner->prepare( 'SELECT id FROM ' . $this->tables->links() . ' WHERE fixed_by = %d ORDER BY id LIMIT %d', $fix_id, $limit ) ); foreach ( $rows as $row ) { $this->list_again( RowColumns::whole_number( $row, 'id' ) ); } return count( $rows ); } public function list_again( int $link_id ): void { $this->query_runner->update( $this->tables->links(), array( 'outcome' => Outcome::Listed->value, 'fixed_by' => null, 'redirect_to' => null, ), array( 'id' => $link_id ) ); } }