I am developing a website using the SilverStripe CMS. I am having a little problem with querying DataObjects. I am trying to get all the DataObjects in one go as follows to optimize performance:
DataObject::get();
When call this I get the following error:
[Emergency] Uncaught InvalidArgumentException: Call ::get() instead of DataObject::get()
If I could query it, I would like to do further operations like this:
DataObject::get()->filterAny([ 'ClassName' => 'ClassName' ]);
I have also tried to use the following query:
$sqlQuery = new SQLQuery();
$sqlQuery->setFrom('Player');
But the issue is that I do not know what is the name of the global / parent table name DataObject.
Is it possible to do what I am trying to do in SilverStripe and, if so, how?