Source of file Db.php
Size: 2,823 Bytes - Last Modified: 2017-11-08T13:54:24+00:00
/home/travis/build/bluzphp/framework/src/Proxy/Db.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 | <?php /** * Bluz Framework Component * * @copyright Bluz PHP Team * @link https://github.com/bluzphp/framework */ declare(strict_types=1); namespace Bluz\Proxy; use Bluz\Db\Db as Instance; use Bluz\Db\Query; /** * Proxy to Db * * Example of usage * <code> * use Bluz\Proxy\Db; * * Db::fetchAll('SELECT * FROM users'); * </code> * * @package Bluz\Proxy * @author Anton Shevchuk * * @method static Instance getInstance() * * @method static mixed getOption($key, $section = null) * @see Instance::getOption() * * @method static \PDO handler() * @see Instance::handler() * * @method static string quote($value) * @see Instance::quote() * * @method static string quoteIdentifier($identifier) * @see Instance::quoteIdentifier() * * @method static integer query($sql, $params = [], $types = []) * @see Instance::query() * * @method static Query\Select select($select) * @see Instance::select() * * @method static Query\Insert insert($table) * @see Instance::insert() * * @method static Query\Update update($table) * @see Instance::update() * * @method static Query\Delete delete($table) * @see Instance::delete() * * @method static string fetchOne($sql, $params = []) * @see Instance::fetchOne() * * @method static array fetchRow($sql, $params = []) * @see Instance::fetchRow() * * @method static array fetchAll($sql, $params = []) * @see Instance::fetchAll() * * @method static array fetchColumn($sql, $params = []) * @see Instance::fetchColumn() * * @method static array fetchGroup($sql, $params = [], $object = null)) * @see Instance::fetchGroup() * * @method static array fetchColumnGroup($sql, $params = []) * @see Instance::fetchColumnGroup() * * @method static array fetchUniqueGroup($sql, $params = []) * @see Instance::fetchUniqueGroup() * * @method static array fetchPairs($sql, $params = []) * @see Instance::fetchPairs() * * @method static array fetchObject($sql, $params = [], $object = "stdClass") * @see Instance::fetchObject() * * @method static array fetchObjects($sql, $params = [], $object = null) * @see Instance::fetchObjects() * * @method static array fetchRelations($sql, $params = []) * @see Instance::fetchRelations() * * @method static bool transaction($process) * @see Instance::transaction() * * @method static void disconnect() * @see Instance::disconnect() */ final class Db { use ProxyTrait; /** * Init instance * * @return Instance */ private static function initInstance() { $instance = new Instance(); $instance->setOptions(Config::getData('db')); return $instance; } } |