diff options
author | Christophe Coevoet <stof@notk.org> | 2012-05-19 00:52:13 +0200 |
---|---|---|
committer | Christophe Coevoet <stof@notk.org> | 2012-05-19 00:52:13 +0200 |
commit | 90d91253a31d0bf7f952c6d79bff57355ca98671 (patch) | |
tree | cd6e8905acad7d8c481291afd980681fee705f91 | |
parent | 5c269f9908716eb81d710b38ba04c2879eab0607 (diff) |
Updated to the new Form and DataFixtures interfaces
11 files changed, 21 insertions, 17 deletions
diff --git a/src/Tolkiendil/AssoBundle/Form/Type/DatePickerType.php b/src/Tolkiendil/AssoBundle/Form/Type/DatePickerType.php index 504cc34..73de9b7 100644 --- a/src/Tolkiendil/AssoBundle/Form/Type/DatePickerType.php +++ b/src/Tolkiendil/AssoBundle/Form/Type/DatePickerType.php @@ -6,7 +6,7 @@ use Symfony\Component\Form\AbstractType; class DatePickerType extends AbstractType { - public function getDefaultOptions(array $options) + public function getDefaultOptions() { return array( 'widget' => 'single_text', diff --git a/src/Tolkiendil/GameBundle/DataFixtures/ORM/IrcFixtures.php b/src/Tolkiendil/GameBundle/DataFixtures/ORM/IrcFixtures.php index 0843fc3..cbf923d 100644 --- a/src/Tolkiendil/GameBundle/DataFixtures/ORM/IrcFixtures.php +++ b/src/Tolkiendil/GameBundle/DataFixtures/ORM/IrcFixtures.php @@ -3,6 +3,7 @@ namespace Tolkiendil\GameBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\FixtureInterface; +use Doctrine\Common\Persistence\ObjectManager; use Tolkiendil\GameBundle\IrcQuiz\Parser; /** @@ -10,7 +11,7 @@ use Tolkiendil\GameBundle\IrcQuiz\Parser; */ class IrcFixtures implements FixtureInterface { - public function load($manager) + public function load(ObjectManager $manager) { $parser = new Parser($manager); diff --git a/src/Tolkiendil/GameBundle/DataFixtures/ORM/QuizFixtures.php b/src/Tolkiendil/GameBundle/DataFixtures/ORM/QuizFixtures.php index 232ad32..055f129 100644 --- a/src/Tolkiendil/GameBundle/DataFixtures/ORM/QuizFixtures.php +++ b/src/Tolkiendil/GameBundle/DataFixtures/ORM/QuizFixtures.php @@ -3,6 +3,7 @@ namespace Tolkiendil\GameBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\FixtureInterface; +use Doctrine\Common\Persistence\ObjectManager; use Tolkiendil\GameBundle\Entity\Quiz; use Tolkiendil\GameBundle\Entity\Question; use Tolkiendil\GameBundle\Entity\Answer; @@ -12,7 +13,7 @@ use Tolkiendil\GameBundle\Entity\Answer; */ class QuizFixtures implements FixtureInterface { - public function load($manager) + public function load(ObjectManager $manager) { $quiz = new Quiz(); $quiz->setTitle('QCM de test'); diff --git a/src/Tolkiendil/GameBundle/DataFixtures/ORM/WordFixtures.php b/src/Tolkiendil/GameBundle/DataFixtures/ORM/WordFixtures.php index e53758a..a0b93e8 100644 --- a/src/Tolkiendil/GameBundle/DataFixtures/ORM/WordFixtures.php +++ b/src/Tolkiendil/GameBundle/DataFixtures/ORM/WordFixtures.php @@ -3,6 +3,7 @@ namespace Tolkiendil\GameBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\FixtureInterface; +use Doctrine\Common\Persistence\ObjectManager; use Tolkiendil\GameBundle\Entity\Word; use Symfony\Component\Yaml\Yaml; @@ -11,7 +12,7 @@ use Symfony\Component\Yaml\Yaml; */ class WordFixtures implements FixtureInterface { - public function load($manager) + public function load(ObjectManager $manager) { $words = Yaml::parse(__DIR__.'/data/words.yml'); diff --git a/src/Tolkiendil/GameBundle/DataFixtures/ORM/WordSearchFixtures.php b/src/Tolkiendil/GameBundle/DataFixtures/ORM/WordSearchFixtures.php index 3359432..e8ac1e8 100644 --- a/src/Tolkiendil/GameBundle/DataFixtures/ORM/WordSearchFixtures.php +++ b/src/Tolkiendil/GameBundle/DataFixtures/ORM/WordSearchFixtures.php @@ -3,6 +3,7 @@ namespace Tolkiendil\GameBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\FixtureInterface; +use Doctrine\Common\Persistence\ObjectManager; use Tolkiendil\GameBundle\Entity\WordSearch; /** @@ -10,7 +11,7 @@ use Tolkiendil\GameBundle\Entity\WordSearch; */ class WordSearchFixtures implements FixtureInterface { - public function load($manager) + public function load(ObjectManager $manager) { $wordSearch = new WordSearch(); $wordSearch->setTitle('Mots-cachés 1 - Les Hobbits - Pierre Nicolay'); diff --git a/src/Tolkiendil/GameBundle/Entity/Quiz.php b/src/Tolkiendil/GameBundle/Entity/Quiz.php index b86e59a..1a41024 100644 --- a/src/Tolkiendil/GameBundle/Entity/Quiz.php +++ b/src/Tolkiendil/GameBundle/Entity/Quiz.php @@ -82,7 +82,7 @@ class Quiz /** * Add question * - * @param Tolkiendil\GameBundle\Entity\Question $question + * @param Question $question */ public function addQuestion(Question $question) { @@ -95,7 +95,7 @@ class Quiz /** * Get question * - * @return Doctrine\Common\Collections\Collection $questions + * @return \Doctrine\Common\Collections\Collection $questions */ public function getQuestions() { diff --git a/src/Tolkiendil/GameBundle/Form/QuestionFormType.php b/src/Tolkiendil/GameBundle/Form/QuestionFormType.php index 3da7139..f0d71ad 100644 --- a/src/Tolkiendil/GameBundle/Form/QuestionFormType.php +++ b/src/Tolkiendil/GameBundle/Form/QuestionFormType.php @@ -41,7 +41,7 @@ class QuestionFormType extends AbstractType $view->set('question', $form->getAttribute('question')); } - public function getDefaultOptions(array $options) + public function getDefaultOptions() { return array( 'question' => null, diff --git a/src/Tolkiendil/GameBundle/Form/QuizFormType.php b/src/Tolkiendil/GameBundle/Form/QuizFormType.php index 6cb4d0a..1317fd5 100644 --- a/src/Tolkiendil/GameBundle/Form/QuizFormType.php +++ b/src/Tolkiendil/GameBundle/Form/QuizFormType.php @@ -32,7 +32,7 @@ class QuizFormType extends AbstractType $builder->setData($options['quiz']); } - public function getDefaultOptions(array $options) + public function getDefaultOptions() { return array( 'quiz' => null, diff --git a/src/Tolkiendil/GameBundle/Form/Type/Admin/LetterCollectionType.php b/src/Tolkiendil/GameBundle/Form/Type/Admin/LetterCollectionType.php index 0b9ef89..a7fd94c 100644 --- a/src/Tolkiendil/GameBundle/Form/Type/Admin/LetterCollectionType.php +++ b/src/Tolkiendil/GameBundle/Form/Type/Admin/LetterCollectionType.php @@ -6,10 +6,10 @@ use Symfony\Component\Form\AbstractType; class LetterCollectionType extends AbstractType { - public function getDefaultOptions(array $options) + public function getDefaultOptions() { return array( - 'prototype_name' => 'col', + 'prototype_name' => '__col__', 'options' => array( 'attr' => array( 'maxlength' => 1, diff --git a/src/Tolkiendil/GameBundle/Form/Type/Admin/LetterGridType.php b/src/Tolkiendil/GameBundle/Form/Type/Admin/LetterGridType.php index 334358b..6554346 100644 --- a/src/Tolkiendil/GameBundle/Form/Type/Admin/LetterGridType.php +++ b/src/Tolkiendil/GameBundle/Form/Type/Admin/LetterGridType.php @@ -6,10 +6,10 @@ use Symfony\Component\Form\AbstractType; class LetterGridType extends AbstractType { - public function getDefaultOptions(array $options) + public function getDefaultOptions() { return array( - 'prototype_name' => 'row', + 'prototype_name' => '__row__', ); } diff --git a/src/Tolkiendil/GameBundle/Resources/public/js/admin.js b/src/Tolkiendil/GameBundle/Resources/public/js/admin.js index 7250625..6411feb 100644 --- a/src/Tolkiendil/GameBundle/Resources/public/js/admin.js +++ b/src/Tolkiendil/GameBundle/Resources/public/js/admin.js @@ -5,7 +5,7 @@ jQuery(function($) { button = $('<li>').attr('class', 'btn').text('Ajouter un mot').bind('click', function(event) { var count = self.data('children-count'); self.data('children-count', count+1); - self.append($(self.data('prototype').replace(/\$\$name\$\$/g, count))); + self.append($(self.data('prototype').replace(/__name__/g, count))); event.preventDefault(); }); self.after($('<div>').append($('<ul>').attr('class', 'form-buttons').append(button))); @@ -20,11 +20,11 @@ jQuery(function($) { var count = self.data('children-count'); var childCount = self.data('grand-children-count'); self.data('children-count', count+1); - var prototype = $(self.data('prototype').replace(/\$\$row\$\$/g, count)); + var prototype = $(self.data('prototype').replace(/__row__/g, count)); var row = $('.letter_collection', prototype); var prototypeCell = row.data('prototype'); for (var i = 0; i < childCount; i++) { - row.append($(prototypeCell.replace(/\$\$col\$\$/g, i))) + row.append($(prototypeCell.replace(/__col__/g, i))) } self.append(prototype); } @@ -36,7 +36,7 @@ jQuery(function($) { self.data('grand-children-count', childCount+1); $('.letter_collection', self).each(function(){ var $this = $(this) - var prototypeString = $this.data('prototype').replace(/\$\$col\$\$/g, childCount); + var prototypeString = $this.data('prototype').replace(/__col__/g, childCount); $this.append($(prototypeString)); }) } |