From 2c6608f817fb42437709f52cbcf7834fd594700e Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 20 Aug 2007 22:17:52 +0000 Subject: [PATCH] IDibiVariable -> DibiVariableInterface --- dibi/dibi.php | 2 +- dibi/libs/driver.php | 6 +++--- dibi/libs/resultset.php | 6 +++--- dibi/libs/translator.php | 10 +++++----- examples/date.type.demo.php | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dibi/dibi.php b/dibi/dibi.php index cd49267e..001ffa47 100644 --- a/dibi/dibi.php +++ b/dibi/dibi.php @@ -45,7 +45,7 @@ require_once dirname(__FILE__).'/libs/exception.php'; /** * Interface for user variable, used for generating SQL */ -interface IDibiVariable +interface DibiVariableInterface { /** * Format for SQL diff --git a/dibi/libs/driver.php b/dibi/libs/driver.php index d4e83f99..5cc3fd1f 100644 --- a/dibi/libs/driver.php +++ b/dibi/libs/driver.php @@ -256,9 +256,9 @@ abstract class DibiDriver * Access to undeclared property * @throws Exception */ - 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"); } + private function __get($name) { 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"); } + private function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); } /**#@-*/ diff --git a/dibi/libs/resultset.php b/dibi/libs/resultset.php index f11e7984..071eecdd 100644 --- a/dibi/libs/resultset.php +++ b/dibi/libs/resultset.php @@ -404,9 +404,9 @@ abstract class DibiResult implements IteratorAggregate, Countable * Access to undeclared property * @throws Exception */ - 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"); } + private function __get($name) { 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"); } + private function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); } /**#@-*/ } // class DibiResult diff --git a/dibi/libs/translator.php b/dibi/libs/translator.php index 063db191..5f1c7f62 100644 --- a/dibi/libs/translator.php +++ b/dibi/libs/translator.php @@ -188,7 +188,7 @@ final class DibiTranslator if ($modifier) { if ($value === NULL) return 'NULL'; - if ($value instanceof IDibiVariable) + if ($value instanceof DibiVariableInterface) return $value->toSql($this->driver, $modifier); if (!is_scalar($value)) { // array is already processed @@ -278,7 +278,7 @@ final class DibiTranslator if ($value === NULL) return 'NULL'; - if ($value instanceof IDibiVariable) + if ($value instanceof DibiVariableInterface) return $value->toSql($this->driver); $this->hasError = TRUE; @@ -381,9 +381,9 @@ final class DibiTranslator * Access to undeclared property * @throws Exception */ - 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"); } + private function __get($name) { 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"); } + private function __unset($name) { throw new Exception("Access to undeclared property: " . get_class($this) . "::$$name"); } /**#@-*/ } // class DibiParser diff --git a/examples/date.type.demo.php b/examples/date.type.demo.php index 339d9411..74d08b5d 100644 --- a/examples/date.type.demo.php +++ b/examples/date.type.demo.php @@ -10,7 +10,7 @@ if (function_exists('date_default_timezone_set')) /** * Pseudotype for UNIX timestamp representation */ -class TDateTime implements IDibiVariable +class MyDateTime implements DibiVariableInterface { /** * Unix timestamp @@ -72,6 +72,6 @@ dibi::test(" INSERT INTO [mytable]", array( 'A' => 12, 'B' => NULL, - 'C' => new TDateTime(31542), // using out class + 'C' => new MyDateTime(31542), // using out class 'D' => 'any string', ));