I've created a module that connects to the database and retrieves some data using
$data = $db->loadRowList();
inside one of the member functions of the module helper class. Is there a way I can store that $data
object as a member variable of the class so I can use it in other member functions of the class? My idea is to use $data
in my Ajax functions. I've tried defining it like this :
class MyModuleHelper{
private $data;
public static MyDatabaseFunction($params)
{
....
self::$data = $db->loadRowList();
...
//here self::$data is full
}
public static MyAjaxFunction()
{
//here self::$data is empty
}
.....
}