Skip to content

Commit

Permalink
refactor DoctrineLayer and downgrade doctrine/dbal
Browse files Browse the repository at this point in the history
  • Loading branch information
niklongstone committed May 21, 2015
1 parent d307673 commit 7964cbe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
@@ -1,3 +1,7 @@
0.6.2 / 2015-05-21
==================
* Downgrade doctrine/dbal

0.6.1 / 2015-05-19
==================
* Removed deprecated method fillEntity and fillTable
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -14,7 +14,7 @@
],
"require": {
"php": ">=5.3.0",
"doctrine/dbal": "2.5.1",
"doctrine/dbal": "~2.4.2",
"twig/twig": "~1.0"
},
"require-dev": {
Expand Down
12 changes: 1 addition & 11 deletions src/Fakerino/Core/Database/DoctrineLayer.php
Expand Up @@ -91,17 +91,7 @@ public function isColumnAutoincrement($num)
*/
public function insert(DbRowEntity $rows)
{
$queryBuilder = self::$conn->createQueryBuilder();
$sql = $queryBuilder->insert($this->tableName);
$values = array();
$types = array();
$rowsElement = $rows->getFields();
foreach ($rowsElement as $field) {
$sql->setValue($field->getName(), '?');
$values[] = $field->getValue();
$types[] = $field->getType();
}
self::$conn->executeQuery($sql, $values, $types);
self::$conn->insert($this->tableName, $rows->toArray());

return true;
}
Expand Down

0 comments on commit 7964cbe

Please sign in to comment.