Loading Objekts

To fetch a single object

$objekt = Objekt::getObjektWhere("objektID = 1234");

many :

$objekts = Objekt::getObjektsWhere("authorID = 1234");

you can also use a QueryObject

$qo = new QueryObject();
$qo->where("authorID = 1234");
wherePublished($qo);
$qo->orderBy("lastModified desc");
$objekts = Objekt::getObjektsFromQO($qo);


The objekts will have their 'array' variable loaded with the combined natural database and unserialized fields from the data field.

The $objekt->id variable will be set to the objektID.

Objekt::standardSelect is used to specify the commonly used fields :

$qo->select("objekt_objekt","objektID");
$qo->select("objekt_objekt","class");
$qo->select("objekt_objekt","title");
$qo->select("objekt_objekt","summary");
$qo->select("objekt_objekt","data");
$qo->select("objekt_objekt","authorID");
$qo->select("objekt_objekt","sections");
$qo->select("objekt_objekt","contentStartTime");
$qo->select("objekt_objekt","contentEndTime");
$qo->select("objekt_objekt","online");
$qo->select("objekt_objekt","publishStart");
$qo->select("objekt_objekt","publishEnd");
$qo->select("objekt_objekt","createdOn");
$qo->select("objekt_objekt","userfield1");
$qo->select("objekt_objekt","userfield2");
$qo->select("objekt_objekt","userfield3");
$qo->select("objekt_objekt","rating");

Then each of the InputObjects is passed the $qo and allowed to select further things (or join to tables) as needed.


For cases where you only need the title and the objektID, it would be nice to have another method that selects just those. That would be much more efficient for the db.