ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Survey\Sequence\SequenceDBRepository Class Reference
+ Collaboration diagram for ILIAS\Survey\Sequence\SequenceDBRepository:

Public Member Functions

 __construct (InternalDataService $data, \ilDBInterface $db)
 
 insert (int $survey_id, int $svy_question_id)
 

Protected Member Functions

 count (int $survey_id)
 

Protected Attributes

InternalDataService $data
 
ilDBInterface $db
 

Detailed Description

Definition at line 25 of file SequenceDBRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Survey\Sequence\SequenceDBRepository::__construct ( InternalDataService  $data,
\ilDBInterface  $db 
)

Member Function Documentation

◆ count()

ILIAS\Survey\Sequence\SequenceDBRepository::count ( int  $survey_id)
protected

Definition at line 38 of file SequenceDBRepository.php.

38 : int
39 {
40 $set = $this->db->queryF(
41 "SELECT count(*) cnt FROM svy_svy_qst " .
42 " WHERE survey_fi = %s ",
43 ["integer"],
44 [$survey_id]
45 );
46 if ($rec = $this->db->fetchAssoc($set)) {
47 return (int) $rec["cnt"];
48 }
49 return 0;
50 }

Referenced by ILIAS\Survey\Sequence\SequenceDBRepository\insert().

+ Here is the caller graph for this function:

◆ insert()

ILIAS\Survey\Sequence\SequenceDBRepository::insert ( int  $survey_id,
int  $svy_question_id 
)

Definition at line 52 of file SequenceDBRepository.php.

52 : int
53 {
54 $order_nr = $this->count($survey_id);
55 $next_id = $this->db->nextId('svy_svy_qst');
56 $this->db->manipulateF(
57 "INSERT INTO svy_svy_qst (survey_question_id, survey_fi," .
58 "question_fi, sequence, tstamp) VALUES (%s, %s, %s, %s, %s)",
59 array('integer', 'integer', 'integer', 'integer', 'integer'),
60 array($next_id, $survey_id, $svy_question_id, $order_nr, time())
61 );
62 return $next_id;
63 }

References ILIAS\Survey\Sequence\SequenceDBRepository\count().

+ Here is the call graph for this function:

Field Documentation

◆ $data

InternalDataService ILIAS\Survey\Sequence\SequenceDBRepository::$data
protected

◆ $db

ilDBInterface ILIAS\Survey\Sequence\SequenceDBRepository::$db
protected

The documentation for this class was generated from the following file: