mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 14:16:39 +02:00
IDibiVariable -> DibiVariableInterface
This commit is contained in:
@@ -45,7 +45,7 @@ require_once dirname(__FILE__).'/libs/exception.php';
|
|||||||
/**
|
/**
|
||||||
* Interface for user variable, used for generating SQL
|
* Interface for user variable, used for generating SQL
|
||||||
*/
|
*/
|
||||||
interface IDibiVariable
|
interface DibiVariableInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Format for SQL
|
* Format for SQL
|
||||||
|
@@ -256,9 +256,9 @@ abstract class DibiDriver
|
|||||||
* Access to undeclared property
|
* Access to undeclared property
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
final function __get($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
|
private 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"); }
|
private 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"); }
|
private function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
|
||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -404,9 +404,9 @@ abstract class DibiResult implements IteratorAggregate, Countable
|
|||||||
* Access to undeclared property
|
* Access to undeclared property
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
final function __get($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
|
private 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"); }
|
private 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"); }
|
private function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
|
||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
} // class DibiResult
|
} // class DibiResult
|
||||||
|
@@ -188,7 +188,7 @@ final class DibiTranslator
|
|||||||
if ($modifier) {
|
if ($modifier) {
|
||||||
if ($value === NULL) return 'NULL';
|
if ($value === NULL) return 'NULL';
|
||||||
|
|
||||||
if ($value instanceof IDibiVariable)
|
if ($value instanceof DibiVariableInterface)
|
||||||
return $value->toSql($this->driver, $modifier);
|
return $value->toSql($this->driver, $modifier);
|
||||||
|
|
||||||
if (!is_scalar($value)) { // array is already processed
|
if (!is_scalar($value)) { // array is already processed
|
||||||
@@ -278,7 +278,7 @@ final class DibiTranslator
|
|||||||
if ($value === NULL)
|
if ($value === NULL)
|
||||||
return 'NULL';
|
return 'NULL';
|
||||||
|
|
||||||
if ($value instanceof IDibiVariable)
|
if ($value instanceof DibiVariableInterface)
|
||||||
return $value->toSql($this->driver);
|
return $value->toSql($this->driver);
|
||||||
|
|
||||||
$this->hasError = TRUE;
|
$this->hasError = TRUE;
|
||||||
@@ -381,9 +381,9 @@ final class DibiTranslator
|
|||||||
* Access to undeclared property
|
* Access to undeclared property
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
final function __get($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
|
private 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"); }
|
private 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"); }
|
private function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); }
|
||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
} // class DibiParser
|
} // class DibiParser
|
||||||
|
@@ -10,7 +10,7 @@ if (function_exists('date_default_timezone_set'))
|
|||||||
/**
|
/**
|
||||||
* Pseudotype for UNIX timestamp representation
|
* Pseudotype for UNIX timestamp representation
|
||||||
*/
|
*/
|
||||||
class TDateTime implements IDibiVariable
|
class MyDateTime implements DibiVariableInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Unix timestamp
|
* Unix timestamp
|
||||||
@@ -72,6 +72,6 @@ dibi::test("
|
|||||||
INSERT INTO [mytable]", array(
|
INSERT INTO [mytable]", array(
|
||||||
'A' => 12,
|
'A' => 12,
|
||||||
'B' => NULL,
|
'B' => NULL,
|
||||||
'C' => new TDateTime(31542), // using out class
|
'C' => new MyDateTime(31542), // using out class
|
||||||
'D' => 'any string',
|
'D' => 'any string',
|
||||||
));
|
));
|
||||||
|
Reference in New Issue
Block a user