DB.PHP - PHP ORM

Save without knowing object class

If you donw know which class belongs to object but you know that class handler is registered in orm than just:

object $database->save (object $object [, integer $action=null]);

This method returns same object you passed back.

And gives following possibility:

$user = $database->save (new user ('John Smith'));

$action optionally can be specified to force save behavior. Allowed values for action are \db\query::insert and \db\query::update.