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

setRefs() private method

Updates the refs for the given statement.
private setRefs ( stdClass $statement, array $refs, StoreOptions $opts )
$statement stdClass
$refs array
$opts StoreOptions
    private function setRefs(\stdClass $statement, array $refs, StoreOptions $opts)
    {
        $this->where($opts)->where('statement.id', $statement->id)->update(['refs' => array_map(function ($ref) {
            $statement = Helpers::replaceFullStop(json_decode(json_encode($ref->statement), true));
            $stored = new Carbon($statement['stored']);
            $timestamp = new Carbon($statement['timestamp']);
            $statement['stored'] = new MongoDate($stored->timestamp, $stored->micro);
            $statement['timestamp'] = new MongoDate($timestamp->timestamp, $timestamp->micro);
            return $statement;
        }, $refs)]);
    }