Version20150825141100.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 Version20150825141100 extends AbstractMigrationChamilo
  10. {
  11. /**
  12. * @param Schema $schema
  13. */
  14. public function up(Schema $schema)
  15. {
  16. $this->addSettingCurrent(
  17. 'show_full_skill_name_on_skill_wheel',
  18. null,
  19. 'radio',
  20. 'Platform',
  21. 'false',
  22. 'ShowFullSkillNameOnSkillWheelTitle',
  23. 'ShowFullSkillNameOnSkillWheelComment',
  24. null,
  25. null,
  26. 1,
  27. false,
  28. true,
  29. [
  30. ['value' => 'true', 'text' => 'Yes'],
  31. ['value' => 'false', 'text' => 'No']
  32. ]
  33. );
  34. }
  35. /**
  36. * @param Schema $schema
  37. */
  38. public function down(Schema $schema)
  39. {
  40. $entityManage = $this->getEntityManager();
  41. $deleteOptions = $entityManage->createQueryBuilder();
  42. $deleteSettings = $entityManage->createQueryBuilder();
  43. $deleteOptions->delete('ChamiloCoreBundle:SettingsOptions', 'o')
  44. ->andWhere(
  45. $deleteOptions->expr()->in(
  46. 'o.variable',
  47. ['show_full_skill_name_on_skill_wheel']
  48. )
  49. );
  50. $deleteOptions->getQuery()->execute();
  51. $deleteSettings->delete('ChamiloCoreBundle:SettingsCurrent', 's')
  52. ->andWhere(
  53. $deleteSettings->expr()->in(
  54. 's.variable',
  55. ['show_full_skill_name_on_skill_wheel']
  56. )
  57. );
  58. $deleteSettings->getQuery()->execute();
  59. }
  60. }