◆ buildFilterStage()
ilCmiXapiStatementsReportLinkBuilder::buildFilterStage |
( |
| ) |
|
|
protected |
- Returns
- mixed[][]
i don't think this will work with user >~ 100 this will blow up the GET request GET Queries are sometimes limited to an amount of characters
Definition at line 84 of file class.ilCmiXapiStatementsReportLinkBuilder.php.
References ilObjCmiXapi\CONT_TYPE_CMI5, ILIAS\Repository\filter(), ilCmiXapiAbstractReportLinkBuilder\getObj(), ilCmiXapiAbstractReportLinkBuilder\getObjId(), ilCmiXapiUser\getUserIdents(), ilCmiXapiUser\getUsersForObject(), and null.
Referenced by buildPipeline().
86 $cmi5_extensions_query =
false;
89 $stage[
'statement.object.objectType'] =
'Activity';
90 $stage[
'statement.actor.objectType'] =
'Agent';
91 if ($this->
filter->getVerb()) {
92 $stage[
'statement.verb.id'] = $this->
filter->getVerb();
95 if ($this->
filter->getStartDate() || $this->
filter->getEndDate()) {
96 $stage[
'statement.timestamp'] = array();
99 $stage[
'statement.timestamp'][
'$gt'] = $this->
filter->getStartDate()->toXapiTimestamp();
103 $stage[
'statement.timestamp'][
'$lt'] = $this->
filter->getEndDate()->toXapiTimestamp();
108 $activityId = array();
112 $activityId[
'statement.context.extensions.https://ilias&46;de/cmi5/activityid'] = $obj->getActivityId();
116 '$regex' =>
'^' . preg_quote($this->
filter->getActivityId()) .
'' 118 $activityId[
'$or'] = [];
123 $activityId[
'$or'][] = [
'statement.object.id' => $activityQuery];
124 $activityId[
'$or'][] = [
'statement.context.contextActivities.parent.id' => $activityQuery];
130 if ($obj->isMixedContentType()) {
131 if ($this->
filter->getActor()) {
134 $actor[
'$or'][] = [
'statement.actor.mbox' =>
"mailto:{$usrIdent}"];
135 $actor[
'$or'][] = [
'statement.actor.account.name' =>
"{$usrIdent}"];
138 if (count($actor) == 0) {
139 $actor[
'$or'][] = [
'statement.actor.mbox' =>
"mailto:{$this->filter->getActor()->getUsrIdent()}"];
140 $actor[
'$or'][] = [
'statement.actor.account.name' =>
"{$this->filter->getActor()->getUsrIdent()}"];
145 $actor[
'$or'][] = [
'statement.actor.mbox' =>
"mailto:{$cmixUser->getUsrIdent()}"];
146 $actor[
'$or'][] = [
'statement.actor.account.name' =>
"{$cmixUser->getUsrIdent()}"];
150 if ($this->
filter->getActor()) {
151 $cmixUser = $this->
filter->getActor();
152 $actor[
'statement.context.registration'] = $cmixUser->getRegistration();
155 if ($this->
filter->getActor()) {
157 $actor[
'$or'][] = [
'statement.actor.mbox' =>
"mailto:{$usrIdent}"];
160 if (count($actor) == 0) {
161 $actor[
'statement.actor.mbox'] = $this->
filter->getActor()->getUsrIdent();
172 $actor[
'$or'][] = [
'statement.actor.mbox' =>
"mailto:{$cmixUser->getUsrIdent()}"];
177 $stage[
'$and'][] = $activityId;
178 if (count($actor) > 0) {
179 $stage[
'$and'][] = $actor;
181 return array(
'$match' => $stage);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getUserIdents(int $objId, int $usrId)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
static getUsersForObject(int $objId, bool $asUsrId=false)
◆ buildLimitStage()
ilCmiXapiStatementsReportLinkBuilder::buildLimitStage |
( |
| ) |
|
|
protected |
◆ buildOrderingStage()
ilCmiXapiStatementsReportLinkBuilder::buildOrderingStage |
( |
| ) |
|
|
protected |
- Returns
- array<string, int[]>
Definition at line 187 of file class.ilCmiXapiStatementsReportLinkBuilder.php.
References ilObject\_lookupType(), ilObjCmiXapi\CONT_TYPE_CMI5, ILIAS\Repository\filter(), ilCmiXapiAbstractReportLinkBuilder\getObj(), and ilObjCmiXapi\PRIVACY_NAME_NONE.
Referenced by buildPipeline().
193 $privacyName = $obj->getProvider()->getPrivacyName();
195 $privacyName = $obj->getPrivacyName();
199 $actor =
'statement.actor.name';
202 if ($obj->getPublisherId() ==
'') {
203 $actor =
'statement.actor.mbox';
205 $actor =
'statement.actor.account.name';
208 $actor =
'statement.actor.mbox';
211 switch ($this->
filter->getOrderField()) {
213 $field =
'statement.object.id';
217 $field =
'statement.verb.id';
226 $field =
'statement.timestamp';
230 $orderingFields = array(
231 $field => $this->
filter->getOrderDirection() ==
'desc' ? -1 : 1
234 return [
'$sort' => $orderingFields];
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
static _lookupType(int $id, bool $reference=false)
◆ buildPipeline()
ilCmiXapiStatementsReportLinkBuilder::buildPipeline |
( |
| ) |
|
|
protected |
The documentation for this class was generated from the following file: