Author: jwage
Date: 2008-05-17 02:21:57 +0100 (Sat, 17 May 2008)
New Revision: 4371
Modified:
branches/0.11/lib/Doctrine/Table.php
Log:
fixes #1048
Modified: branches/0.11/lib/Doctrine/Table.php
===================================================================
--- branches/0.11/lib/Doctrine/Table.php 2008-05-17 01:17:12 UTC (rev 4370)
+++ branches/0.11/lib/Doctrine/Table.php 2008-05-17 01:21:57 UTC (rev 4371)
@@ -1898,35 +1898,75 @@
return $this->_templates[$template];
}
+ /**
+ * Check if the table has a template name
+ *
+ * @param string $template
+ * @return boolean $bool
+ */
public function hasTemplate($template)
{
return isset($this->_templates[$template]);
}
+ /**
+ * Add template to the table
+ *
+ * @param string $template
+ * @param Doctrine_Template $impl
+ * @return Doctrine_Table
+ */
public function addTemplate($template, Doctrine_Template $impl)
{
$this->_templates[$template] = $impl;
return $this;
}
+
+ /**
+ * Get all the generators for the table
+ *
+ * @return array $generators
+ */
+
public function getGenerators()
{
return $this->_generators;
}
+
+ /**
+ * Get generator instance for a passed name
+ *
+ * @param string $generator
+ * @return Doctrine_Record_Generator $generator
+ */
public function getGenerator($generator)
{
if ( ! isset($this->_generators[$generator])) {
throw new Doctrine_Table_Exception('Generator ' . $generator . ' not loaded');
}
- return $this->_generators[$plugin];
+ return $this->_generators[$generator];
}
+ /**
+ * Check if a generator name exists
+ *
+ * @param string $generator
+ * @return void
+ */
public function hasGenerator($generator)
{
return isset($this->_generators[$generator]);
}
+ /**
+ * Add a generate to the table instance
+ *
+ * @param Doctrine_Record_Generator $generator
+ * @param string $name
+ * @return Doctrine_Table
+ */
public function addGenerator(Doctrine_Record_Generator $generator, $name = null)
{
if ($name === null) {
@@ -1936,6 +1976,7 @@
}
return $this;
}
+
/**
* bindQueryParts
* binds query parts to given component