1
0
mirror of synced 2025-01-20 07:21:40 +03:00
This commit is contained in:
zYne 2007-07-18 19:31:43 +00:00
parent b13a70c087
commit 941a2e5761
2 changed files with 8 additions and 3 deletions

View File

@ -129,7 +129,7 @@ class Doctrine_AuditLog
return $q->execute($values, Doctrine_HYDRATE::HYDRATE_ARRAY);
}
public function buildDefinition(Doctrine_Table $table)
{
{
$this->_options['className'] = str_replace('%CLASS%',
$this->_options['table']->getComponentName(),
$this->_options['className']);
@ -143,6 +143,9 @@ class Doctrine_AuditLog
}
$columns = $table->getColumns();
// the version column should be part of the primary key definition
$columns[$this->_options['versionColumn']]['primary'] = true;
$id = $table->getIdentifier();
@ -150,8 +153,6 @@ class Doctrine_AuditLog
$builder = new Doctrine_Import_Builder();
$options['primary'][] = $this->_options['versionColumn'];
$def = $builder->buildDefinition($options, $columns);
if ( ! $this->_options['generateFiles']) {

View File

@ -1375,6 +1375,10 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
->getAuditLog()
->getVersion($this, $version);
if ( ! isset($data[0])) {
throw new Doctrine_Record_Exception('Version ' . $version . ' does not exist!');
}
$this->_data = $data[0];
}
/**