abstract public function tables($name = null);
/**
+ * Get a Horde_Db_Adapter_Abstract_Table object for the table.
+ *
+ * @param string $tableName
+ * @param string $name
+ *
+ * @return Horde_Db_Adapter_Abstract_Table
+ */
+ public function table($tableName, $name = null)
+ {
+ return $this->componentFactory('Table', array(
+ $tableName,
+ $this->columns($tableName, $name),
+ $this->indexes($tableName, $name),
+ ));
+ }
+
+ /**
* Return a table's primary key
*/
abstract public function primaryKey($tableName, $name = null);
--- /dev/null
+<?php
+/**
+ * Copyright 2007 Maintainable Software, LLC
+ * Copyright 2008 The Horde Project (http://www.horde.org/)
+ *
+ * @author Mike Naberezny <mike@maintainable.com>
+ * @author Derek DeVries <derek@maintainable.com>
+ * @author Chuck Hagenbuch <chuck@horde.org>
+ * @license http://opensource.org/licenses/bsd-license.php
+ * @category Horde
+ * @package Horde_Db
+ * @subpackage Adapter
+ */
+
+/**
+ * @author Mike Naberezny <mike@maintainable.com>
+ * @author Derek DeVries <derek@maintainable.com>
+ * @author Chuck Hagenbuch <chuck@horde.org>
+ * @license http://opensource.org/licenses/bsd-license.php
+ * @category Horde
+ * @package Horde_Db
+ * @subpackage Adapter
+ */
+class Horde_Db_Adapter_Abstract_Table
+{
+ protected $_name;
+ protected $_primaryKey;
+ protected $_columns;
+ protected $_indexes;
+
+
+ /*##########################################################################
+ # Construct/Destruct
+ ##########################################################################*/
+
+ /**
+ * Construct
+ *
+ * @param string $name The table's name, such as <tt>supplier_id</tt> in <tt>supplier_id int(11)</tt>.
+ */
+ public function __construct($name, $columns, $indexes)
+ {
+ $this->_name = $name;
+ $this->_columns = $columns;
+ $this->_indexes = $indexes;
+ }
+
+
+ /*##########################################################################
+ # Accessor
+ ##########################################################################*/
+
+ /**
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->_name;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getPrimaryKey()
+ {
+ return $this->_primaryKey;
+ }
+
+ /**
+ * @return array
+ */
+ public function getColumns()
+ {
+ return $this->_columns;
+ }
+
+ /**
+ * @return array
+ */
+ public function getColumnNames()
+ {
+ $names = array();
+ foreach ($this->_columns as $column) {
+ $names[] = $column->getName();
+ }
+ return $names;
+ }
+
+ /**
+ * @return array
+ */
+ public function getIndexes()
+ {
+ return $this->_indexes;
+ }
+
+ /**
+ * @return array
+ */
+ public function getIndexNames()
+ {
+ $names = array();
+ foreach ($this->_indexes as $index) {
+ $names[] = $index->getName();
+ }
+ return $names;
+ }
+
+
+ /*##########################################################################
+ # Protected
+ ##########################################################################*/
+
+}
<file name="ColumnDefinition.php" role="php" />
<file name="Index.php" role="php" />
<file name="Schema.php" role="php" />
+ <file name="Table.php" role="php" />
<file name="TableDefinition.php" role="php" />
</dir> <!-- /lib/Horde/Db/Adapter/Abstract -->
<dir name="Mssql">
<install name="lib/Horde/Db/Adapter/Abstract/ColumnDefinition.php" as="Horde/Db/Adapter/Abstract/ColumnDefinition.php" />
<install name="lib/Horde/Db/Adapter/Abstract/Index.php" as="Horde/Db/Adapter/Abstract/Index.php" />
<install name="lib/Horde/Db/Adapter/Abstract/Schema.php" as="Horde/Db/Adapter/Abstract/Schema.php" />
+ <install name="lib/Horde/Db/Adapter/Abstract/Table.php" as="Horde/Db/Adapter/Abstract/Table.php" />
<install name="lib/Horde/Db/Adapter/Abstract/TableDefinition.php" as="Horde/Db/Adapter/Abstract/TableDefinition.php" />
<install name="lib/Horde/Db/Adapter/Abstract.php" as="Horde/Db/Adapter/Abstract.php" />