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;
  }
Esempio n. 2
0
function db($connectionName)
{
    return DbModule::getConnection($connectionName);
}
Esempio n. 3
0
<?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);
    }
}
Esempio n. 4
0
 /**
  * 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));
 }
Esempio n. 5
0
 public function __construct($params)
 {
     $this->db = DbModule::getConnection($params['db_connection']);
     $this->style = $params['style'];
     $this->lifetime = $params['lifetime'];
 }
Esempio n. 6
0
function SqlBumpTableSequenceToEnd($tableName)
{
    return DbModule::getDefaultConnection()->bumpTableSequenceToEnd($tableName);
}
Esempio n. 7
0
 public static function setEntityManager(DoctrineEntityManager $entityManager)
 {
     self::$entityManager = $entityManager;
 }
Esempio n. 8
0
function SqlDeleteRows($sql, $params)
{
    return DbModule::getDefaultConnection()->deleteRows($sql, $params);
}