I have a method that basically returns the results of a mysql query.
public function getStuff() {
$this->sort = "myColumn ASC";
$query = ... ORDER BY $this->sort;
return $data;
}
I'd like to reuse that result, only with a different sort order, and it seems like I should be able to grab that data in another method, just by calling the original method. Like this:
public function getMoreStuff() {
$this->sort = "anotherColumn DESC";
$this->getStuff();
}
But, while "getStuff()" is returning data as expected, "getMoreStuff()" doesn't return anything. I'm sure it's not necessary to copy the entire query into my second method, but am at a loss on how I can include it. Any guidance would be very appreciated. Thanks!