public function makeSelectString($table, $fields='*', $where='', $order='', $count=0, $start=0) { $sql = parent :: makeSelectString($table, $fields, $where, $order, $count, $start); if ($count) $sql .= "\nLIMIT $start, $count"; return $sql; }
function db($connectionName) { return DbModule::getConnection($connectionName); }
<?php include 'config.php'; include zoop_dir . '/Zoop.php'; Zoop::loadLib('app'); Zoop::loadLib('db'); $schema = new DbSchema(DbModule::getDefaultConnection()); foreach ($schema->tables as $thisTable) { // echo_r($thisTable); echo "<strong>Table name = {$thisTable->name}</strong><br>"; foreach ($thisTable->fields as $thisField) { echo "field name = {$thisField->name} field type = {$thisField->type}<br>"; // echo_r($thisField); } }
/** * Static method to return the database connection associated with a given DbObject * * @param string $className Name of the DbObject to retreive the default connection of * @return DbConnection object */ private static function _getConnection($className) { return DbModule::getConnection(call_user_func(array($className, '_getConnectionName'), $className)); }
public function __construct($params) { $this->db = DbModule::getConnection($params['db_connection']); $this->style = $params['style']; $this->lifetime = $params['lifetime']; }
function SqlBumpTableSequenceToEnd($tableName) { return DbModule::getDefaultConnection()->bumpTableSequenceToEnd($tableName); }
public static function setEntityManager(DoctrineEntityManager $entityManager) { self::$entityManager = $entityManager; }
function SqlDeleteRows($sql, $params) { return DbModule::getDefaultConnection()->deleteRows($sql, $params); }