47 $query =
'SELECT * FROM lti_consumer_results' 48 .
' WHERE id = ' . $DIC->database()->quote($a_id,
'integer');
51 if ($row = $DIC->database()->fetchAssoc(
$res)) {
69 public static function getByKeys($a_obj_id, $a_usr_id, $a_create =
false)
73 $query =
'SELECT * FROM lti_consumer_results' 74 .
' WHERE obj_id = ' . $DIC->database()->quote($a_obj_id,
'integer')
75 .
' AND usr_id = ' . $DIC->database()->quote($a_usr_id,
'integer');
78 if ($row = $DIC->database()->fetchAssoc(
$res)) {
82 } elseif ($a_create) {
84 $resObj->obj_id = $a_obj_id;
85 $resObj->usr_id = $a_usr_id;
86 $resObj->result = null;
100 $this->
id =
$data[
'id'];
101 $this->obj_id =
$data[
'obj_id'];
102 $this->usr_id =
$data[
'usr_id'];
103 $this->result =
$data[
'result'];
113 if (!isset($this->usr_id) or !isset($this->obj_id)) {
116 if (!isset($this->
id)) {
117 $this->
id = $DIC->database()->nextId(
'lti_consumer_results');
119 $DIC->database()->replace(
120 'lti_consumer_results',
122 'id' => array(
'integer', $this->
id)
125 'obj_id' => array(
'integer', $this->obj_id),
126 'usr_id' => array(
'integer', $this->usr_id),
127 'result' => array(
'float', $this->result)
173 $query =
'SELECT * FROM lti_consumer_results' 174 .
' WHERE obj_id = ' . $DIC->database()->quote(
$objId,
'integer');
180 if ($row = $DIC->database()->fetchAssoc(
$res)) {
184 $results[$resObj->getUsrId()] = $resObj;
static getById($a_id)
Get a result by id.
static getByKeys($a_obj_id, $a_usr_id, $a_create=false)
Get a result by object and user key.
save()
Save a result object.
fillData($data)
Fill the properties with data from an array.
static getResultsForObject($objId)
foreach($_POST as $key=> $value) $res