From 9200d1271a3e86260ebf320dcf1c627d5cd59a73 Mon Sep 17 00:00:00 2001 From: zYne Date: Wed, 22 Nov 2006 18:15:21 +0000 Subject: [PATCH] small refactorings --- lib/Doctrine/Expression.php | 17 +++++++++++++++-- lib/Doctrine/Import/Builder.php | 13 ++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/lib/Doctrine/Expression.php b/lib/Doctrine/Expression.php index 43b0bb5c9..2073aa923 100644 --- a/lib/Doctrine/Expression.php +++ b/lib/Doctrine/Expression.php @@ -186,9 +186,9 @@ class Doctrine_Expression extends Doctrine_Connection_Module { * locate * returns the position of the first occurrence of substring $substr in string $str * - * @param string $substr literal string + * @param string $substr literal string to find * @param string $str literal string - * @return string + * @return integer */ public function locate($substr, $str) { return 'LOCATE(' . $str . ', ' . $substr . ')'; @@ -201,6 +201,19 @@ class Doctrine_Expression extends Doctrine_Connection_Module { public function now() { return 'NOW()'; } + /** + * soundex + * Returns a string to call a function to compute the + * soundex encoding of a string + * + * The string "?000" is returned if the argument is NULL. + * + * @param string $value + * @return string SQL soundex function with given parameter + */ + public function soundex($value) { + throw new Doctrine_Expression_Exception('SQL soundex function not supported by this driver.'); + } /** * return string to call a function to get a substring inside an SQL statement * diff --git a/lib/Doctrine/Import/Builder.php b/lib/Doctrine/Import/Builder.php index 49ec2f26e..b33fbec13 100644 --- a/lib/Doctrine/Import/Builder.php +++ b/lib/Doctrine/Import/Builder.php @@ -143,16 +143,15 @@ class Doctrine_Import_Builder { /** * * @param Doctrine_Schema_Object $schema - * @return - * @access public * @throws Doctrine_Import_Exception + * @return void */ public function build(Doctrine_Schema_Object $schema) { - foreach($schema->getDatabases() as $database){ - foreach($database->getTables() as $table){ - $this->buildRecord($table); - } - } + foreach($schema->getDatabases() as $database){ + foreach($database->getTables() as $table){ + $this->buildRecord($table); + } + } } }