Skip to content
LaCodon edited this page Mar 1, 2016 · 1 revision

namespace Famework\Db

This class gives access to simple database functions.

Contents

Relevant public methods

loadInstance

Get a new database instance: \PDO obejct.
This method gets automatically called by Famework\Famework::_construct().
You can then get the \PDO obejct via Famework\Registry\Famework_Registry::getDb()

static \PDO loadInstance(Famework\Config\Famework_Config $config)
Parameter Purpose
config The config.ini file
RETURN a \PDO obejct

getAsObject

Converts a SQL result into an object.

static mixed getAsObject(array $fetchAll [, string $class = "\stdClass"])
Parameter Purpose
fetchAll The result of \PDOStatement::fetchAll()
class The class type of the created object(s)
RETURN Array of Objects or object if single result