phptin-can-apilrslearning-locker

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?


Solution

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