Locker\Repository\Lrs\EloquentRepository::getStatementCount PHP Method

getStatementCount() public method

Get a statement count, either for an LRS or for the entire site if no lrs_id passed
public getStatementCount ( $lrs_id = null )
    public function getStatementCount($lrs_id = null)
    {
        $collection = \DB::getCollection('statements');
        $query = [];
        //Limit by LRS
        if ($lrs_id) {
            if (!$lrs_id instanceof \MongoId) {
                $lrs_id = new \MongoId($lrs_id);
            }
            $query['lrs_id'] = $lrs_id;
        }
        return $collection->count($query, ['hint' => ['lrs_id' => 1]]);
    }