MongoHybrid\ResultSet::hasOne PHP Method

hasOne() public method

public hasOne ( $collections )
    public function hasOne($collections)
    {
        foreach ($this as &$doc) {
            foreach ($collections as $fkey => $collection) {
                if (isset($doc[$fkey]) && $doc[$fkey]) {
                    if (!isset($this->cache[$collection][$doc[$fkey]])) {
                        $this->cache[$collection][$doc[$fkey]] = $this->driver->findOneById($collection, $doc[$fkey]);
                    }
                    $doc[$fkey] = $this->cache[$collection][$doc[$fkey]];
                }
            }
        }
    }