Locker\Repository\Statement\EloquentLinker::eagerLoadUpRefs PHP Method

eagerLoadUpRefs() private method

Gets the statements referencing the given statement ids.
private eagerLoadUpRefs ( array $statement_ids, StoreOptions $opts ) : [\stdClass]
$statement_ids array
$opts StoreOptions
return [\stdClass]
    private function eagerLoadUpRefs(array $statement_ids, StoreOptions $opts)
    {
        $models = $this->where($opts)->whereIn('statement.object.id', $statement_ids)->where('statement.object.objectType', 'StatementRef')->get();
        $collatedStatements = [];
        foreach ($models as $model) {
            $objectId = $model->statement['object']['id'];
            if (!isset($collatedStatements[$objectId])) {
                $collatedStatements[$objectId] = new Collection();
            }
            $collatedStatements[$objectId]->push($model);
        }
        return $collatedStatements;
    }