Peter Rubi
Peter Rubi

Reputation: 119

learning locker queryStatement using timestamp as a filter

I'm trying to query on statements stored in Learning Locker using TinCanPHP but I want to retrieve only the statements generated in a specific interval of time. For example, I want all the statements generated today.

How can I do it?

Upvotes: 1

Views: 417

Answers (1)

Grant_Bailey
Grant_Bailey

Reputation: 308

Try this:

$LRSResponse = $LRS->queryStatements(['since' => '2016-11-15', 'ascending' => false]); // change to 'true', or omit, for ascending dates
$StatementsResult = $LRSResponse->content;
$array_of_Statement_objects = $StatementsResult->getStatements();
foreach ($array_of_Statement_objects as $extracted_Statement_object){
// deal with statements as necessary
}
unset($extracted_Statement_object);

Upvotes: 1

Related Questions