[Poll] Added variable num of options

not sure if it is the right way to do it
This commit is contained in:
Daniel
2020-11-09 17:43:10 +00:00
committed by Hugo Sales
parent 8543c8c68e
commit 0a1ea8749b
8 changed files with 158 additions and 50 deletions

View File

@@ -105,7 +105,9 @@ class PollResponse extends Entity
// }}} Autocode
/**
* The One True Thingy that must be defined and declared.
* Entity schema definition
*
* @return array schema definition
*/
public static function schemaDef()
{
@@ -134,6 +136,14 @@ class PollResponse extends Entity
];
}
/**
* Checks if a user already responded to the poll
*
* @param int $pollId
* @param int $gsactorId user
*
* @return bool
*/
public static function exits(int $pollId, int $gsactorId): bool
{
$res = DB::dql('select pr from App\Entity\PollResponse pr