DB.PHP - PHP ORM

Load affecting default load behavior or changing table default query

Every table handler has built in query object. When you call it without passing query handler uses built in query to process your request. For example if you want to change default behavior of load without creating query object:

$database->shop->product->load ();

Let us say you want to chane default order field for all load calls of products, than you should:

$database->shop->product->query->order('name');

After this where ever you call load result will be ordered by name, default query is active even when you are using \db\by

$database->shop->product->load (\db\by('type',$type));

For more information about queries see: Query where, Query order, Query limit