Phalcon\Db\Adapter\Mongo\DbRef::getRelated PHP Method

getRelated() public method

public getRelated ( )
    public function getRelated()
    {
        $db = $this->collection->db;
        $ref = $this->ref;
        if (empty($ref['$db'])) {
            $collection = $db->selectCollection($ref['$ref']);
        } else {
            $collection = $db->conn->selectCollection($ref['$db'], $ref['$ref']);
        }
        $doc = self::get($db, $ref);
        if (is_null($doc)) {
            return null;
        }
        return new Document($collection, $doc);
    }