From 22a249456954b37b17fdd1e6962b03bd1284b02e Mon Sep 17 00:00:00 2001 From: zYne Date: Wed, 6 Jun 2007 00:12:44 +0000 Subject: [PATCH] --- lib/Doctrine/AuditLog.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/AuditLog.php b/lib/Doctrine/AuditLog.php index e51adc2e8..1f4083407 100644 --- a/lib/Doctrine/AuditLog.php +++ b/lib/Doctrine/AuditLog.php @@ -83,16 +83,22 @@ class Doctrine_AuditLog $data['columns'] = array_merge(array($this->_options['identifier'] => array('type' => 'integer', 'primary' => true, + 'length' => 8, 'autoinc' => true)), $data['columns']); - - $definition = 'class ' . str_replace('%CLASS%', $this->_table->getComponentName(), $this->_options['className']) + $className = str_replace('%CLASS%', $this->_table->getComponentName(), $this->_options['className']); + $definition = 'class ' . $className . ' extends Doctrine_Record { ' . 'public function setTableDefinition() { ' . '$this->hasColumns(' . var_export($data['columns'], true) . ');' . '$this->option(\'tableName\', \'' . $data['tableName'] . '\'); } }'; - + + $this->_table->getRelationParser()->bind($className, array( + 'local' => $this->_table->getIdentifier(), + 'foreign' => $this->_table->getIdentifier(), + 'type' => Doctrine_Relation::MANY)); + print $definition; eval( $definition );