Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
latoilescoute-dev
scoodle
Commits
46df3b6f
Commit
46df3b6f
authored
Apr 08, 2018
by
m
Browse files
change test
parent
179235ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/classes/Framadate/Services/PollService.php
View file @
46df3b6f
...
...
@@ -112,7 +112,7 @@ class PollService {
* @return \stdClass
*/
function
addVote
(
$poll_id
,
$name
,
$choices
,
$slots_hash
)
{
$this
->
checkVoteConstraints
(
$choices
,
$poll_id
,
$slots_hash
,
$name
,
NULL
);
$this
->
checkVoteConstraints
(
$choices
,
$poll_id
,
$slots_hash
,
$name
);
// Insert new vote
$choices
=
implode
(
$choices
);
...
...
@@ -298,14 +298,14 @@ class PollService {
* @param $poll_id
* @param $slots_hash
* @param $name
* @param string
|NULL
$vote_id
* @param string $vote_id
* @throws AlreadyExistsException
* @throws ConcurrentVoteException
* @throws ConcurrentEditionException
*/
private
function
checkVoteConstraints
(
$choices
,
$poll_id
,
$slots_hash
,
$name
,
$vote_id
)
{
private
function
checkVoteConstraints
(
$choices
,
$poll_id
,
$slots_hash
,
$name
,
$vote_id
=
FALSE
)
{
// Check if vote already exists with the same name
if
(
!
isset
(
$vote_id
)
)
{
if
(
FALSE
===
$vote_id
)
{
$exists
=
$this
->
voteRepository
->
existsByPollIdAndName
(
$poll_id
,
$name
);
}
else
{
$exists
=
$this
->
voteRepository
->
existsByPollIdAndNameAndVoteId
(
$poll_id
,
$name
,
$vote_id
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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