*/ public function find( FixRequest $fix_request ): array { $selection = $fix_request->selection; $condition = $selection instanceof Verdict ? 'links.verdict = %s' : 'links.id IN (' . implode( ',', array_fill( 0, count( $selection ), '%d' ) ) . ')'; $values = $selection instanceof Verdict ? array( $selection->value ) : $selection; $rows = $this->query_runner->rows( $this->query_runner->prepare( 'SELECT ' . $this->tables->link_columns() . ' FROM ' . $this->tables->links() . ' links' . ' WHERE links.outcome = %s' . ' AND links.verdict IN (%s, %s, %s)' . ' AND ' . $condition . ' ORDER BY links.id', Outcome::Listed->value, Verdict::Broken->value, Verdict::Blocked->value, Verdict::Moved->value, ...$values ) ); $targets = array(); foreach ( $rows as $row ) { $link = $this->link_row_mapper->to_link( $row ); if ( $fix_request->action->applies_to( $link ) ) { $targets[] = $link; } } return $targets; } }