Flush at the end.

1.10.x
Julio Montoya 10 years ago
parent 4c6339c741
commit 3ca8b86481
  1. 7
      app/Migrations/AbstractMigrationChamilo.php

@ -30,7 +30,6 @@ abstract class AbstractMigrationChamilo extends AbstractMigration
*/ */
public function getEntityManager() public function getEntityManager()
{ {
if (empty($this->manager)) { if (empty($this->manager)) {
$dbParams = array( $dbParams = array(
'driver' => 'pdo_mysql', 'driver' => 'pdo_mysql',
@ -100,7 +99,7 @@ abstract class AbstractMigrationChamilo extends AbstractMigration
->setAccessUrlLocked($accessUrlLocked); ->setAccessUrlLocked($accessUrlLocked);
$this->getEntityManager()->persist($setting); $this->getEntityManager()->persist($setting);
$this->getEntityManager()->flush(); //$this->getEntityManager()->flush();
if (count($options) > 0) { if (count($options) > 0) {
foreach ($options as $option) { foreach ($options as $option) {
@ -111,14 +110,16 @@ abstract class AbstractMigrationChamilo extends AbstractMigration
$option['text'] = 'No'; $option['text'] = 'No';
} }
} }
$settingOption = new SettingsOptions(); $settingOption = new SettingsOptions();
$settingOption $settingOption
->setVariable($variable) ->setVariable($variable)
->setValue($option['value']) ->setValue($option['value'])
->setDisplayText($option['text']); ->setDisplayText($option['text']);
$this->getEntityManager()->persist($settingOption); $this->getEntityManager()->persist($settingOption);
$this->getEntityManager()->flush();
} }
} }
$this->getEntityManager()->flush();
} }
} }

Loading…
Cancel
Save