learning locker queryStatement using timestamp as a filter

409 views Asked by At

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?

1

There are 1 answers

2
Grant_Bailey On BEST ANSWER

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);