1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 05:37:39 +02:00

* vetsina method/trid oznacena jako final

This commit is contained in:
David Grudl
2007-08-09 03:31:34 +00:00
parent 609a3d64fb
commit 8b89eb3bd0
12 changed files with 68 additions and 38 deletions

View File

@@ -130,7 +130,7 @@ class dibi
* dibi::query() error mode
* @var bool
*/
public static $throwExceptions = FALSE;
public static $throwExceptions = TRUE;
/**
* Substitutions for identifiers
@@ -320,6 +320,36 @@ class dibi
/**
* Begins a transaction - Monostate for DibiDriver::begin()
*/
public static function begin()
{
return self::getConnection()->begin();
}
/**
* Commits statements in a transaction - Monostate for DibiDriver::commit()
*/
public static function commit()
{
return self::getConnection()->commit();
}
/**
* Rollback changes in a transaction - Monostate for DibiDriver::rollback()
*/
public static function rollback()
{
return self::getConnection()->rollback();
}
private static function dumpHighlight($matches)
{
if (!empty($matches[1])) // comment

View File

@@ -75,7 +75,7 @@ abstract class DibiDriver
* @see DibiDriver::__construct
* @return array
*/
public function getConfig()
final public function getConfig()
{
return $this->config;
}
@@ -86,7 +86,7 @@ abstract class DibiDriver
* Returns the connection resource
* @return resource
*/
public function getConnection()
final public function getConnection()
{
if (!$this->connection) $this->connection = $this->connect();
@@ -102,7 +102,7 @@ abstract class DibiDriver
* @return int|DibiResult
* @throws DibiException
*/
public function query($args)
final public function query($args)
{
// receive arguments
if (!is_array($args))
@@ -256,9 +256,9 @@ abstract class DibiDriver
* Access to undeclared property
* @throws Exception
*/
function __get($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
function __set($name, $value) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
final function __get($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
final function __set($name, $value) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
final function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
/**#@-*/

View File

@@ -37,13 +37,13 @@ class DibiException extends Exception
}
public function getSql()
final public function getSql()
{
return $this->sql;
}
public function getDbError()
final public function getDbError()
{
return $this->dbError;
}

View File

@@ -294,7 +294,7 @@ abstract class DibiResult implements IteratorAggregate, Countable
public function setType($field, $type = NULL)
final public function setType($field, $type = NULL)
{
if ($field === TRUE)
$this->detectTypes();
@@ -309,14 +309,14 @@ abstract class DibiResult implements IteratorAggregate, Countable
/** is this needed? */
public function getType($field)
final public function getType($field)
{
return isset($this->convert[$field]) ? $this->convert[$field] : NULL;
}
public function convert($value, $type)
final public function convert($value, $type)
{
if ($value === NULL || $value === FALSE)
return $value;
@@ -341,7 +341,7 @@ abstract class DibiResult implements IteratorAggregate, Countable
* Gets an array of field names
* @return array
*/
public function getFields()
final public function getFields()
{
// lazy init
if ($this->meta === NULL) $this->buildMeta();
@@ -355,7 +355,7 @@ abstract class DibiResult implements IteratorAggregate, Countable
* @param string column name
* @return array
*/
public function getMetaData($field)
final public function getMetaData($field)
{
// lazy init
if ($this->meta === NULL) $this->buildMeta();
@@ -368,7 +368,7 @@ abstract class DibiResult implements IteratorAggregate, Countable
* Acquires ....
* @return void
*/
protected function detectTypes()
final protected function detectTypes()
{
if ($this->meta === NULL) $this->buildMeta();
}
@@ -383,7 +383,7 @@ abstract class DibiResult implements IteratorAggregate, Countable
/** these are the required IteratorAggregate functions */
public function getIterator($offset = NULL, $count = NULL)
final public function getIterator($offset = NULL, $count = NULL)
{
return new DibiResultIterator($this, $offset, $count);
}
@@ -392,7 +392,7 @@ abstract class DibiResult implements IteratorAggregate, Countable
/** these are the required Countable functions */
public function count()
final public function count()
{
return $this->rowCount();
}
@@ -404,9 +404,9 @@ abstract class DibiResult implements IteratorAggregate, Countable
* Access to undeclared property
* @throws Exception
*/
function __get($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
function __set($name, $value) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
final function __get($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
final function __set($name, $value) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
final function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
/**#@-*/
} // class DibiResult
@@ -437,7 +437,7 @@ abstract class DibiResult implements IteratorAggregate, Countable
* }
* </code>
*/
class DibiResultIterator implements Iterator
final class DibiResultIterator implements Iterator
{
private
$result,

View File

@@ -21,7 +21,7 @@ if (!class_exists('dibi', FALSE)) die();
* dibi translator
*
*/
class DibiTranslator
final class DibiTranslator
{
private
$driver,
@@ -381,9 +381,9 @@ class DibiTranslator
* Access to undeclared property
* @throws Exception
*/
function __get($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
function __set($name, $value) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
final function __get($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
final function __set($name, $value) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
final function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
/**#@-*/
} // class DibiParser