From 5b7089cb86fa89a6e7828af9cde70e150d64113b Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 24 Nov 2006 20:51:40 +0000 Subject: [PATCH] added implementation for getSequenceName and getIndexName --- lib/Doctrine/Connection.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/Connection.php b/lib/Doctrine/Connection.php index a22f2d950..5629adecf 100644 --- a/lib/Doctrine/Connection.php +++ b/lib/Doctrine/Connection.php @@ -273,11 +273,25 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun } return $idx; } - public function getIndexName($idx) { - return $idx; - } + /** + * adds sequence name formatting to a sequence name + * + * @param string name of the sequence + * @return string formatted sequence name + */ public function getSequenceName($sqn) { - return $sqn; + return sprintf($this->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT), + preg_replace('/[^a-z0-9_\$.]/i', '_', $sqn)); + } + /** + * adds index name formatting to a index name + * + * @param string name of the index + * @return string formatted index name + */ + public function getIndexName($idx) { + return sprintf($this->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT), + preg_replace('/[^a-z0-9_\$]/i', '_', $idx)); } /**