A
A
Azamat Ualkhanov2013-12-17 15:39:10
Kohana
Azamat Ualkhanov, 2013-12-17 15:39:10

Why is the request not working in kohane orm?

$places = ORM::factory('place');
 $places -> find_all();

Generates a query but returns no data. What could be the problem ?
And this is how it works:
$places = ORM::factory('place')->find_all();

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Osher, 2013-12-17
@Azamatdev

In the first case, probably, the second line should be something like $places = $places->find_all();, because you need to put the result into some variable.
Let's analyze it in the course: it
ORM::factory('place')returns an ORM object. You put it in a variable $places. Then you call the method find_all(), but don't assign the result anywhere.
In the second case, you put the result of the method find_all()into a variable.

A
Andrey Filatov, 2013-12-17
@wendel

$places = ORM::factory('place');
$places_array = $places -> find_all();
var_dump($places_array);
In the first option, you simply did not assign the result to a variable as in the second.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question