Questions tagged [result-object]

An object that contains multiple values for use in languages that only support single return types (eg java) when the need exists to return multiple values

A term used to describe instances of classes that exist only because the language being used does not support a multi-valued return type (such as java), when the need exists to return several values.

The concept is similar to a struct in C.

For example, in java:

class FileProcessingResult {
    boolean success;
    int errorLine;
    String errorMessage;
}
3 questions
0
votes
1 answer

how to convert data type from result_object codeigniter

I have an array of objects from the query as follows : Array ( [0] => stdClass Object ( [row_number] => 1 [cash_id] => 30938 [closing_id] => [is_closed] => 0 [cash_date] =>…
0
votes
7 answers

Is returning null from a "get error message" method an anti-pattern?

Is it "bad practice" to effectively cache the result of executing expensive stateless checking code by returning a null in the case of a "no problem found"? The upside is minimal code and no class/code bloat. This is illustrated by this code: public…
Bohemian
  • 412,405
  • 93
  • 575
  • 722
-1
votes
2 answers

How to fetch all data from a SELECT query as an array of associative rows in Wordpress?

I take it from the database and send it via ajax (wordpress). Everything works fine, except that I don't get the first row from the database. As I read on the Internet, a similar problem is in the array, maybe. Can someone explain and help me fix it…
maja
  • 177
  • 1
  • 13