From: Chuck Hagenbuch Date: Mon, 5 Jan 2009 04:55:58 +0000 (-0500) Subject: remove unused primary settings on the Column object X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d4f38403d597aa5241997082fbf80c493b4e00d4;p=horde.git remove unused primary settings on the Column object --- diff --git a/framework/Db/lib/Horde/Db/Adapter/Abstract/Column.php b/framework/Db/lib/Horde/Db/Adapter/Abstract/Column.php index 8b88fbc74..7eacd8764 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Abstract/Column.php +++ b/framework/Db/lib/Horde/Db/Adapter/Abstract/Column.php @@ -26,7 +26,6 @@ class Horde_Db_Adapter_Abstract_Column protected $_name; protected $_type; protected $_null; - protected $_primary; protected $_limit; protected $_precision; protected $_scale; @@ -48,7 +47,7 @@ class Horde_Db_Adapter_Abstract_Column * @param string $sqlType Only used to extract the column's length, if necessary. For example +60+ in company_name varchar(60). * @param boolean $null Determines if this column allows +NULL+ values. */ - public function __construct($name, $default, $sqlType=null, $null=true) + public function __construct($name, $default, $sqlType = null, $null = true) { $this->_name = $name; $this->_sqlType = $sqlType; @@ -58,7 +57,6 @@ class Horde_Db_Adapter_Abstract_Column $this->_scale = $this->_extractScale($sqlType); $this->_type = $this->_simplifiedType($sqlType); $this->_default = $this->extractDefault($default); - $this->_primary = false; $this->_isText = $this->_type == 'text' || $this->_type == 'string'; $this->_isNumber = $this->_type == 'float' || $this->_type == 'integer' || $this->_type == 'decimal'; @@ -187,22 +185,6 @@ class Horde_Db_Adapter_Abstract_Column return $this->_sqlType; } - /** - * @return mixed - */ - public function isPrimary() - { - return $this->_primary; - } - - /** - * @param boolean - */ - public function setPrimary($primary) - { - $this->_primary = $primary; - } - /*########################################################################## # Type Juggling @@ -239,8 +221,8 @@ class Horde_Db_Adapter_Abstract_Column if (empty($string)) { return null; } // preserve '0000-00-00' (http://bugs.php.net/bug.php?id=45647) - if (preg_replace('/[^\d]/', '', $string) == 0) { - return '0000-00-00'; + if (preg_replace('/[^\d]/', '', $string) == 0) { + return '0000-00-00'; } return date('Y-m-d', strtotime($string)); @@ -257,8 +239,8 @@ class Horde_Db_Adapter_Abstract_Column if (empty($string)) { return null; } // preserve '0000-00-00 00:00:00' (http://bugs.php.net/bug.php?id=45647) - if (preg_replace('/[^\d]/', '', $string) == 0) { - return '0000-00-00 00:00:00'; + if (preg_replace('/[^\d]/', '', $string) == 0) { + return '0000-00-00 00:00:00'; } return date('Y-m-d H:i:s', strtotime($string)); diff --git a/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnTest.php b/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnTest.php index a53c462c9..06fb6ad37 100644 --- a/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnTest.php @@ -149,18 +149,6 @@ class Horde_Db_Adapter_Mysql_ColumnTest extends PHPUnit_Framework_TestCase $this->assertEquals('string', $col->getType()); } - /*########################################################################## - # Primary - ##########################################################################*/ - - public function testPrimary() - { - $col = new Horde_Db_Adapter_Mysql_Column('id', 'NULL', 'int(11)'); - $this->assertFalse($col->isPrimary()); - - $col->setPrimary(true); - $this->assertTrue($col->isPrimary()); - } /*########################################################################## # Extract Limit diff --git a/framework/Db/test/Horde/Db/Adapter/Postgresql/ColumnTest.php b/framework/Db/test/Horde/Db/Adapter/Postgresql/ColumnTest.php index 25230891b..07c31fc87 100644 --- a/framework/Db/test/Horde/Db/Adapter/Postgresql/ColumnTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Postgresql/ColumnTest.php @@ -149,18 +149,6 @@ class Horde_Db_Adapter_Postgresql_ColumnTest extends PHPUnit_Framework_TestCase $this->assertEquals('string', $col->getType()); } - /*########################################################################## - # Primary - ##########################################################################*/ - - public function testPrimary() - { - $col = new Horde_Db_Adapter_Postgresql_Column('id', 'NULL', 'int(11)'); - $this->assertFalse($col->isPrimary()); - - $col->setPrimary(true); - $this->assertTrue($col->isPrimary()); - } /*########################################################################## # Extract Limit diff --git a/framework/Db/test/Horde/Db/Adapter/Sqlite/ColumnTest.php b/framework/Db/test/Horde/Db/Adapter/Sqlite/ColumnTest.php index 5e9e2095e..7632cf6be 100644 --- a/framework/Db/test/Horde/Db/Adapter/Sqlite/ColumnTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Sqlite/ColumnTest.php @@ -149,18 +149,6 @@ class Horde_Db_Adapter_Sqlite_ColumnTest extends PHPUnit_Framework_TestCase $this->assertEquals('string', $col->getType()); } - /*########################################################################## - # Primary - ##########################################################################*/ - - public function testPrimary() - { - $col = new Horde_Db_Adapter_Sqlite_Column('id', 'NULL', 'int(11)'); - $this->assertFalse($col->isPrimary()); - - $col->setPrimary(true); - $this->assertTrue($col->isPrimary()); - } /*########################################################################## # Extract Limit