Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathieu Loiseau
MagicWord
Commits
b58f7573
Commit
b58f7573
authored
May 07, 2019
by
Sylvain Hatier
Committed by
Arnaud Bey
Jul 19, 2019
Browse files
Done : Delete lexicon & other entities
parent
65b78b0b
Changes
5
Hide whitespace changes
Inline
Side-by-side
application/package-lock.json
View file @
b58f7573
...
...
@@ -40,7 +40,7 @@
"argparse"
:
{
"version"
:
"1.0.10"
,
"resolved"
:
"https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz"
,
"integrity"
:
"sha
512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=
="
,
"integrity"
:
"sha
1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE
="
,
"requires"
:
{
"sprintf-js"
:
"~1.0.2"
}
...
...
@@ -151,7 +151,7 @@
"brace-expansion"
:
{
"version"
:
"1.1.11"
,
"resolved"
:
"https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz"
,
"integrity"
:
"sha
512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA=
="
,
"integrity"
:
"sha
1-PH/L9SnYcibz0vUrlm/1Jx60Qd0
="
,
"requires"
:
{
"balanced-match"
:
"^1.0.0"
,
"concat-map"
:
"0.0.1"
...
...
@@ -264,7 +264,7 @@
"concat-stream"
:
{
"version"
:
"1.6.2"
,
"resolved"
:
"https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz"
,
"integrity"
:
"sha
512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw=
="
,
"integrity"
:
"sha
1-kEvfGUzTEi/Gdcd/xKw9T/D9GjQ
="
,
"requires"
:
{
"buffer-from"
:
"^1.0.0"
,
"inherits"
:
"^2.0.3"
,
...
...
@@ -366,7 +366,7 @@
"errno"
:
{
"version"
:
"0.1.7"
,
"resolved"
:
"https://registry.npmjs.org/errno/-/errno-0.1.7.tgz"
,
"integrity"
:
"sha
512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg=
="
,
"integrity"
:
"sha
1-RoTXF3mtOa8Xfj8AeZb3xnyFJhg
="
,
"optional"
:
true
,
"requires"
:
{
"prr"
:
"~1.0.1"
...
...
@@ -506,7 +506,7 @@
"function-bind"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
,
"integrity"
:
"sha
512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=
="
"integrity"
:
"sha
1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0
="
},
"gaze"
:
{
"version"
:
"1.1.3"
,
...
...
@@ -835,7 +835,7 @@
"iconv-lite"
:
{
"version"
:
"0.4.23"
,
"resolved"
:
"https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz"
,
"integrity"
:
"sha
512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA=
="
,
"integrity"
:
"sha
1-KXhx9jvlB63Pv8pxXQzQ7thOmmM
="
,
"requires"
:
{
"safer-buffer"
:
">= 2.1.2 < 3"
}
...
...
@@ -876,7 +876,7 @@
"is-buffer"
:
{
"version"
:
"1.1.6"
,
"resolved"
:
"https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz"
,
"integrity"
:
"sha
512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=
="
"integrity"
:
"sha
1-76ouqdqg16suoTqXsritUf776L4
="
},
"is-builtin-module"
:
{
"version"
:
"1.0.0"
,
...
...
@@ -1114,7 +1114,7 @@
"minimatch"
:
{
"version"
:
"3.0.4"
,
"resolved"
:
"https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz"
,
"integrity"
:
"sha
512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA=
="
,
"integrity"
:
"sha
1-UWbihkV/AzBgZL5Ul+jbsMPTIIM
="
,
"requires"
:
{
"brace-expansion"
:
"^1.1.7"
}
...
...
@@ -1297,7 +1297,7 @@
"process-nextick-args"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz"
,
"integrity"
:
"sha
512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=
="
"integrity"
:
"sha
1-o31zL0JxtKsa0HDTVQjoKQeI/6o
="
},
"promise"
:
{
"version"
:
"7.3.1"
,
...
...
@@ -1462,7 +1462,7 @@
"safe-buffer"
:
{
"version"
:
"5.1.2"
,
"resolved"
:
"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz"
,
"integrity"
:
"sha
512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=
="
"integrity"
:
"sha
1-mR7GnSluAxN0fVm9/St0XDX4go0
="
},
"safe-json-parse"
:
{
"version"
:
"1.0.1"
,
...
...
@@ -1473,7 +1473,7 @@
"safer-buffer"
:
{
"version"
:
"2.1.2"
,
"resolved"
:
"https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz"
,
"integrity"
:
"sha
512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=
="
"integrity"
:
"sha
1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo
="
},
"screenfull"
:
{
"version"
:
"3.3.2"
,
...
...
@@ -1521,7 +1521,7 @@
"spdx-expression-parse"
:
{
"version"
:
"3.0.0"
,
"resolved"
:
"https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz"
,
"integrity"
:
"sha
512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg=
="
,
"integrity"
:
"sha
1-meEZt6XaAOBUkcn6M4t5BII7QdA
="
,
"requires"
:
{
"spdx-exceptions"
:
"^2.1.0"
,
"spdx-license-ids"
:
"^3.0.0"
...
...
@@ -1736,7 +1736,7 @@
"websocket-extensions"
:
{
"version"
:
"0.1.3"
,
"resolved"
:
"https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz"
,
"integrity"
:
"sha
512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg=
="
,
"integrity"
:
"sha
1-XS/yKXcAPsaHpLhwc9+7rBRszyk
="
,
"dev"
:
true
},
"which"
:
{
...
...
application/src/LexiconBundle/Command/DeleteLexiconCommand.php
View file @
b58f7573
...
...
@@ -10,6 +10,10 @@ use LexiconBundle\Entity\WordStart;
use
MagicWordBundle\Entity\Grid
;
use
MagicWordBundle\Entity\Game
;
use
MagicWordBundle\Entity\Round
;
use
MagicWordBundle\Entity\Score
;
use
MagicWordBundle\Entity\WrongForm
;
use
MagicWordBundle\Entity\FoundableForm
;
use
MagicWordBundle\Entity\Objective
;
use
Symfony\Component\Filesystem\Filesystem
;
use
Symfony\Component\Console\Input\InputArgument
;
...
...
@@ -38,6 +42,21 @@ class DeleteLexiconCommand extends ContainerAwareCommand
$language
=
$em
->
getRepository
(
Language
::
class
)
->
find
(
$idLexicon
);
echo
'You passed an argument: '
.
$idLexicon
.
"
\n\n
"
;
$games
=
$em
->
getRepository
(
Game
::
class
)
->
findByLanguage
(
$language
);
foreach
(
$games
as
$game
)
{
$scores
=
$em
->
getRepository
(
Score
::
class
)
->
findByGame
(
$game
);
foreach
(
$scores
as
$score
)
{
$em
->
remove
(
$score
);
foreach
(
$score
->
getActivities
()
as
$activity
)
{
$em
->
remove
(
$activity
);
}
$output
->
writeln
(
'<comment>Suppression activity ok</comment>'
);
$output
->
writeln
(
'<comment>Suppression score ok</comment>'
);
}
}
$em
->
flush
();
$output
->
writeln
(
'<comment>flush ok</comment>'
);
// delete games
$em
->
getRepository
(
Game
::
class
)
->
deleteByLanguage
(
$language
);
$output
->
writeln
(
'<comment>Suppression game ok</comment>'
);
...
...
@@ -47,6 +66,7 @@ class DeleteLexiconCommand extends ContainerAwareCommand
foreach
(
$grids
as
$grid
)
{
$em
->
remove
(
$grid
);
}
$em
->
flush
();
$output
->
writeln
(
'<comment>Suppression grilles ok</comment>'
);
$words
=
$em
->
getRepository
(
Word
::
class
)
->
deleteByLanguage
(
$language
);
...
...
@@ -58,6 +78,23 @@ class DeleteLexiconCommand extends ContainerAwareCommand
$wordstarts
=
$em
->
getRepository
(
WordStart
::
class
)
->
deleteByLanguage
(
$language
->
getId
());
$output
->
writeln
(
'<comment>Suppression wordstarts ok</comment>'
);
//Suppression des entités restantes pour la langue : wrongforms, foundforms, combosDone, objectivesDone
$wrongForms
=
$em
->
getRepository
(
WrongForm
::
class
)
->
findByLanguage
(
$language
);
foreach
(
$wrongForms
as
$wrongForm
)
{
$em
->
remove
(
$wrongForm
);
}
$em
->
flush
();
$output
->
writeln
(
'<comment>Suppression wrongForm ok</comment>'
);
/*
$foundForms = $em->getRepository(FoundableForm::class)->findByLanguage($language);
foreach ($foundForms as $foundForm) {
$em->remove($foundForm);
}
$em->flush();
$output->writeln('<comment>Suppression FoundForm ok</comment>');
*/
$em
->
remove
(
$language
);
$output
->
writeln
(
'<comment>Suppression langage ok</comment>'
);
$em
->
flush
();
...
...
application/src/MagicWordBundle/Command/FixturesCommand.php
View file @
b58f7573
...
...
@@ -78,7 +78,7 @@ class FixturesCommand extends ContainerAwareCommand
$acquisitionType
->
setValue
(
$type
);
$em
->
persist
(
$acquisitionType
);
}
$em
->
flush
();
$output
->
writeln
(
'<info>########## FIXTURES DONE ###########</info>'
);
}
}
application/src/MagicWordBundle/Entity/Activity.php
View file @
b58f7573
...
...
@@ -59,7 +59,7 @@ class Activity implements \JsonSerializable
private
$comboPoints
=
0
;
/**
* @ORM\OneToMany(targetEntity="MagicWordBundle\Entity\CombosDone", mappedBy="activity")
* @ORM\OneToMany(targetEntity="MagicWordBundle\Entity\CombosDone", mappedBy="activity"
, cascade={"remove"}
)
*/
private
$combosDone
;
...
...
application/src/MagicWordBundle/Entity/Score.php
View file @
b58f7573
...
...
@@ -46,10 +46,6 @@ class Score
*/
private
$forfeit
;
/**
* @ORM\OneToMany(targetEntity="Activity", mappedBy="score")
*/
/**
* @ORM\ManyToMany(targetEntity="Activity")
* @ORM\JoinTable(name="score_activities",
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment