ILIAS
release_8 Revision v8.19
|
DB survey codes (table. More...
Public Member Functions | |
__construct (InternalDataService $data, \ilDBInterface $db) | |
deleteAll (int $survey_id) | |
Delete all codes of a survey. More... | |
delete (int $survey_id, string $code) | |
Delete single code. More... | |
exists (int $survey_id, string $code) | |
Does code exist in survey? More... | |
add (int $survey_id, string $code="", int $user_id=0, string $email="", string $last_name="", string $first_name="", int $sent=0, int $tstamp=0) | |
Saves a survey access code for a registered user to the database. More... | |
addCodes (int $survey_id, int $nr) | |
Add multiple codes. More... | |
updateExternalData (int $code_id, string $email, string $last_name, string $first_name, int $sent) | |
Update external data of a code. More... | |
getAll (int $survey_id) | |
Get all access keys of a survey. More... | |
getAllData (int $survey_id) | |
Get all codes of a survey. More... | |
getByUserKey (int $survey_id, string $survey_key) | |
bindUser (int $survey_id, string $code, int $user_id) | |
Bind registered user to a code. More... | |
getByUserId (int $survey_id, int $user_id) | |
Get code for a registered user. More... | |
getByCodeId (int $survey_id, int $code_id) | |
Protected Member Functions | |
getNew (int $survey_id) | |
Get a new unique code. More... | |
getUserKey (int $user_id) | |
Get user key for id. More... | |
Protected Attributes | |
ilDBInterface | $db |
InternalDataService | $data |
DB survey codes (table.
Definition at line 29 of file class.CodeDBRepo.php.
ILIAS\Survey\Code\CodeDBRepo::__construct | ( | InternalDataService | $data, |
\ilDBInterface | $db | ||
) |
Definition at line 35 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$data, and ILIAS\Survey\Code\CodeDBRepo\$db.
ILIAS\Survey\Code\CodeDBRepo::add | ( | int | $survey_id, |
string | $code = "" , |
||
int | $user_id = 0 , |
||
string | $email = "" , |
||
string | $last_name = "" , |
||
string | $first_name = "" , |
||
int | $sent = 0 , |
||
int | $tstamp = 0 |
||
) |
Saves a survey access code for a registered user to the database.
Definition at line 128 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$db, $email, ILIAS\Survey\Code\CodeDBRepo\exists(), ILIAS\Survey\Code\CodeDBRepo\getNew(), ILIAS\Survey\Code\CodeDBRepo\getUserKey(), and ILIAS\Survey\Code\CodeDBRepo\updateExternalData().
Referenced by ILIAS\Survey\Code\CodeManager\add(), and ILIAS\Survey\Code\CodeDBRepo\addCodes().
ILIAS\Survey\Code\CodeDBRepo::addCodes | ( | int | $survey_id, |
int | $nr | ||
) |
Add multiple codes.
int | $nr | number of codes that should be generated/added |
Definition at line 182 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\add().
ILIAS\Survey\Code\CodeDBRepo::bindUser | ( | int | $survey_id, |
string | $code, | ||
int | $user_id | ||
) |
Bind registered user to a code.
Definition at line 314 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$db, and ILIAS\Survey\Code\CodeDBRepo\getUserKey().
ILIAS\Survey\Code\CodeDBRepo::delete | ( | int | $survey_id, |
string | $code | ||
) |
Delete single code.
Definition at line 61 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$db, and ilDBInterface\manipulateF().
Referenced by ILIAS\Survey\Code\CodeManager\delete().
ILIAS\Survey\Code\CodeDBRepo::deleteAll | ( | int | $survey_id | ) |
Delete all codes of a survey.
Definition at line 46 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$db, and ilDBInterface\manipulateF().
Referenced by ILIAS\Survey\Code\CodeManager\deleteAll().
ILIAS\Survey\Code\CodeDBRepo::exists | ( | int | $survey_id, |
string | $code | ||
) |
Does code exist in survey?
Definition at line 98 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$db, and ilDBInterface\queryF().
Referenced by ILIAS\Survey\Code\CodeDBRepo\add(), ILIAS\Survey\Code\CodeManager\exists(), and ILIAS\Survey\Code\CodeDBRepo\getNew().
ILIAS\Survey\Code\CodeDBRepo::getAll | ( | int | $survey_id | ) |
Get all access keys of a survey.
Definition at line 233 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$db, and ilDBInterface\queryF().
ILIAS\Survey\Code\CodeDBRepo::getAllData | ( | int | $survey_id | ) |
Get all codes of a survey.
Definition at line 255 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$db, and ilDBInterface\queryF().
ILIAS\Survey\Code\CodeDBRepo::getByCodeId | ( | int | $survey_id, |
int | $code_id | ||
) |
Definition at line 356 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$db, and ilDBInterface\queryF().
ILIAS\Survey\Code\CodeDBRepo::getByUserId | ( | int | $survey_id, |
int | $user_id | ||
) |
Get code for a registered user.
Definition at line 338 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$db, and ILIAS\Survey\Code\CodeDBRepo\getUserKey().
ILIAS\Survey\Code\CodeDBRepo::getByUserKey | ( | int | $survey_id, |
string | $survey_key | ||
) |
Definition at line 282 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$db, and ilDBInterface\queryF().
|
protected |
Get a new unique code.
Definition at line 78 of file class.CodeDBRepo.php.
References $i, $index, and ILIAS\Survey\Code\CodeDBRepo\exists().
Referenced by ILIAS\Survey\Code\CodeDBRepo\add().
|
protected |
Get user key for id.
Definition at line 115 of file class.CodeDBRepo.php.
Referenced by ILIAS\Survey\Code\CodeDBRepo\add(), ILIAS\Survey\Code\CodeDBRepo\bindUser(), and ILIAS\Survey\Code\CodeDBRepo\getByUserId().
ILIAS\Survey\Code\CodeDBRepo::updateExternalData | ( | int | $code_id, |
string | $email, | ||
string | $last_name, | ||
string | $first_name, | ||
int | $sent | ||
) |
Update external data of a code.
Definition at line 196 of file class.CodeDBRepo.php.
References ILIAS\Survey\Code\CodeDBRepo\$db, $ilDB, and ilUtil\is_email().
Referenced by ILIAS\Survey\Code\CodeDBRepo\add().
|
protected |
Definition at line 32 of file class.CodeDBRepo.php.
Referenced by ILIAS\Survey\Code\CodeDBRepo\__construct().
|
protected |
Definition at line 31 of file class.CodeDBRepo.php.
Referenced by ILIAS\Survey\Code\CodeDBRepo\__construct(), ILIAS\Survey\Code\CodeDBRepo\add(), ILIAS\Survey\Code\CodeDBRepo\bindUser(), ILIAS\Survey\Code\CodeDBRepo\delete(), ILIAS\Survey\Code\CodeDBRepo\deleteAll(), ILIAS\Survey\Code\CodeDBRepo\exists(), ILIAS\Survey\Code\CodeDBRepo\getAll(), ILIAS\Survey\Code\CodeDBRepo\getAllData(), ILIAS\Survey\Code\CodeDBRepo\getByCodeId(), ILIAS\Survey\Code\CodeDBRepo\getByUserId(), ILIAS\Survey\Code\CodeDBRepo\getByUserKey(), and ILIAS\Survey\Code\CodeDBRepo\updateExternalData().