Version20150813200000.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. namespace Application\Migrations\Schema\V110;
  4. use Application\Migrations\AbstractMigrationChamilo;
  5. use Doctrine\DBAL\Schema\Schema;
  6. /**
  7. * Calendar color
  8. */
  9. class Version20150813200000 extends AbstractMigrationChamilo
  10. {
  11. /**
  12. * @param Schema $schema
  13. */
  14. public function up(Schema $schema)
  15. {
  16. $entityManage = $this->getEntityManager();
  17. $deleteOptions = $entityManage->createQueryBuilder();
  18. $deleteSettings = $entityManage->createQueryBuilder();
  19. $deleteOptions->delete('ChamiloCoreBundle:SettingsOptions', 'o')
  20. ->andWhere(
  21. $deleteOptions->expr()->in(
  22. 'o.variable',
  23. [
  24. 'math_mimetex'
  25. ]
  26. )
  27. );
  28. $deleteOptions->getQuery()->execute();
  29. $deleteSettings->delete('ChamiloCoreBundle:SettingsCurrent', 's')
  30. ->andWhere(
  31. $deleteSettings->expr()->in(
  32. 's.variable',
  33. [
  34. 'math_mimetex'
  35. ]
  36. )
  37. );
  38. $deleteSettings->getQuery()->execute();
  39. }
  40. /**
  41. * @param Schema $schema
  42. */
  43. public function down(Schema $schema)
  44. {
  45. $this->addSettingCurrent(
  46. 'math_mimetex',
  47. null,
  48. 'radio',
  49. 'Editor',
  50. 'false',
  51. 'MathMimetexTitle',
  52. 'MathMimetexComment',
  53. null,
  54. null,
  55. 1,
  56. false,
  57. true,
  58. [
  59. 0 => ['value' => 'true', 'text' => 'Yes'],
  60. 1 => ['value' => 'false', 'text' => 'No']
  61. ]
  62. );
  63. }
  64. }