Browse files

propelorm#125 Dumping fixtures fails when the table is called 'match'

propelorm#127 Loading of fixtures in an other bundle than the bundle with the model fails
In master branch in commit f589d31.
  • Loading branch information...
1 parent 01bd79c commit bc5c365d8924958ae2f138f6bf323be96db3a3d0 @istaveren committed Mar 14, 2012
Showing with 5 additions and 5 deletions.
  1. +2 −2 DataFixtures/Dumper/AbstractDataDumper.php
  2. +3 −3 DataFixtures/Loader/AbstractDataLoader.php
View
4 DataFixtures/Dumper/AbstractDataDumper.php
@@ -104,11 +104,11 @@ protected function getDataAsArray()
} else {
$in = array();
foreach ($tableMap->getColumns() as $column) {
- $in[] = strtolower($column->getName());
+ $in[] = $this->dbMap->getDBAdapter()->quoteIdentifier(strtolower($column->getName()));
}
$stmt = $this
->con
- ->query(sprintf('SELECT %s FROM %s', implode(',', $in), constant(constant($tableName.'::PEER').'::TABLE_NAME')));
+ ->query(sprintf('SELECT %s FROM %s', implode(', ', $in), $this->dbMap->getDBAdapter()->quoteIdentifier(constant(constant($tableName.'::PEER').'::TABLE_NAME'))));
$resultsSets[] = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
View
6 DataFixtures/Loader/AbstractDataLoader.php
@@ -189,13 +189,13 @@ protected function loadDataFromArray($data = null)
if ($isARealColumn) {
if ($column->isForeignKey() && null !== $value) {
$relatedTable = $this->dbMap->getTable($column->getRelatedTableName());
- if (!isset($this->object_references[$relatedTable->getPhpName().'_'.$value])) {
+ if (!isset($this->object_references[$relatedTable->getClassname().'_'.$value])) {
throw new \InvalidArgumentException(
- sprintf('The object "%s" from class "%s" is not defined in your data file.', $value, $relatedTable->getPhpName())
+ sprintf('The object "%s" from class "%s" is not defined in your data file.', $value, $relatedTable->getClassname())
);
}
$value = $this
- ->object_references[$relatedTable->getPhpName().'_'.$value]
+ ->object_references[$relatedTable->getClassname().'_'.$value]
->getByName($column->getRelatedName(), BasePeer::TYPE_COLNAME);
}
}

1 comment on commit bc5c365

@istaveren
Owner

Ok, I will do that.

Please sign in to comment.