ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAssIncompleteQuestionPurger Class Reference
+ Collaboration diagram for ilAssIncompleteQuestionPurger:

Public Member Functions

 __construct (ilDB $db)
 getOwnerId ()
 setOwnerId ($ownerId)
 purge ()

Protected Member Functions

 setIgnoredContainerObjectTypes ($ignoredContainerObjectTypes)
 getIgnoredContainerObjectTypes ()

Protected Attributes

 $db
 $ownerId

Private Member Functions

 getPurgableQuestionIds ()
 purgeQuestionIds ($questionIds)

Private Attributes

 $ignoredContainerObjectTypes

Detailed Description

Definition at line 11 of file class.ilAssIncompleteQuestionPurger.php.

Constructor & Destructor Documentation

ilAssIncompleteQuestionPurger::__construct ( ilDB  $db)

Definition at line 22 of file class.ilAssIncompleteQuestionPurger.php.

References $db.

{
$this->db = $db;
$this->ignoredContainerObjectTypes = array('lm');
}

Member Function Documentation

ilAssIncompleteQuestionPurger::getIgnoredContainerObjectTypes ( )
protected

Definition at line 87 of file class.ilAssIncompleteQuestionPurger.php.

References $ignoredContainerObjectTypes.

Referenced by getPurgableQuestionIds().

+ Here is the caller graph for this function:

ilAssIncompleteQuestionPurger::getOwnerId ( )

Definition at line 29 of file class.ilAssIncompleteQuestionPurger.php.

References $ownerId.

Referenced by getPurgableQuestionIds().

{
}

+ Here is the caller graph for this function:

ilAssIncompleteQuestionPurger::getPurgableQuestionIds ( )
private

Definition at line 45 of file class.ilAssIncompleteQuestionPurger.php.

References $query, $res, $row, getIgnoredContainerObjectTypes(), and getOwnerId().

Referenced by purge().

{
$INtypes = $this->db->in('object_data.type', $this->getIgnoredContainerObjectTypes(), true, 'text');
$query = "
SELECT qpl_questions.question_id
FROM qpl_questions
INNER JOIN object_data
ON object_data.obj_id = qpl_questions.obj_fi
AND $INtypes
WHERE qpl_questions.owner = %s
AND qpl_questions.tstamp = %s
";
$res = $this->db->queryF($query, array('integer', 'integer'), array($this->getOwnerId(), 0));
$questionIds = array();
while( $row = $this->db->fetchAssoc($res) )
{
$questionIds[] = $row['question_id'];
}
return $questionIds;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssIncompleteQuestionPurger::purge ( )

Definition at line 39 of file class.ilAssIncompleteQuestionPurger.php.

References getPurgableQuestionIds(), and purgeQuestionIds().

{
$questionIds = $this->getPurgableQuestionIds();
$this->purgeQuestionIds($questionIds);
}

+ Here is the call graph for this function:

ilAssIncompleteQuestionPurger::purgeQuestionIds (   $questionIds)
private

Definition at line 71 of file class.ilAssIncompleteQuestionPurger.php.

References assQuestion\_instantiateQuestion().

Referenced by purge().

{
require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
foreach($questionIds as $questionId)
{
$question = assQuestion::_instantiateQuestion($questionId);
$question->delete($questionId);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssIncompleteQuestionPurger::setIgnoredContainerObjectTypes (   $ignoredContainerObjectTypes)
protected

Definition at line 82 of file class.ilAssIncompleteQuestionPurger.php.

References $ignoredContainerObjectTypes.

{
$this->ignoredContainerObjectTypes = $ignoredContainerObjectTypes;
}
ilAssIncompleteQuestionPurger::setOwnerId (   $ownerId)

Definition at line 34 of file class.ilAssIncompleteQuestionPurger.php.

References $ownerId.

{
$this->ownerId = $ownerId;
}

Field Documentation

ilAssIncompleteQuestionPurger::$db
protected

Definition at line 16 of file class.ilAssIncompleteQuestionPurger.php.

Referenced by __construct().

ilAssIncompleteQuestionPurger::$ignoredContainerObjectTypes
private
ilAssIncompleteQuestionPurger::$ownerId
protected

Definition at line 18 of file class.ilAssIncompleteQuestionPurger.php.

Referenced by getOwnerId(), and setOwnerId().


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