Return the result content as MongoDBREf objects.

@return array array of mongo references
179054
public function toRefArray()
    {
        // Retrieve the actual objects.
        $documents = $this->toArray();

        // Get the collection idenfitier
        $collection = (string) $this->collection->getCollection();

        foreach ($documents as &$document) {
            $document = MongoDBRef::create($collection, $document);
        }

        return $documents;
    }
197520
public function getOriginalPaths()
    {
        if (null === $this->originalReferrerPaths) {
            $this->originalReferrerPaths = [];
            if (self::INITIALIZED_FROM_COLLECTION === $this->initialized) {
                $uow = $this->dm->getUnitOfWork();
                foreach ($this->collection as $referrer) {
                    $this->originalReferrerPaths[] = $uow->getDocumentId($referrer);
                }
            } else {
                $properties = $this->getReferrerProperties();
                foreach ($properties as $property) {
                    $this->originalReferrerPaths[] = $property->getPath();
                }
            }
        }

        return $this->originalReferrerPaths;
    }
1092832
public function getRefs() : array
    {
        $refs = [];
        foreach ($this->elements as $key => $val) {
            if (substr($key, 0, 5) == '#ref_') {
                $refs[substr($key, 5)] = $val;
            }
        }

        return $refs;
    }
807871
public function getReferences(): array
    {
        if (empty($this->parent)) {
            throw new NodeException("Unable to aggregate reference values, parent is missing");
        }

        if (empty($this->parent->references[$this->outerKey])) {
            return [];
        }

        return array_keys($this->parent->references[$this->outerKey]);
    }
1211420
public function getContentTypeGroups()
    {
        $contentTypeGroups = array();
        foreach ($this->contentTypeGroupReferences as $reference) {
            $contentTypeGroups[] = $this->contentTypeService->loadContentTypeGroup($reference);
        }

        return $contentTypeGroups;
    }
222266
public function getDatabases()
    {
        $cursor = $this->server->executeCommand('admin', new \MongoDb\Driver\Command(['listDatabases' => 1]));

        $cursor->setTypeMap(['root' => 'array', 'document' => 'array']);
        $result = current($cursor->toArray());

        $this->queriesResultCache[ 'databaseNames' ] = [];

        if ( ! empty($result[ 'databases' ])) {
            foreach ($result[ 'databases' ] as $database) {
                if ( ! in_array($database[ 'name' ], ['admin', 'local'])) {
                    $this->queriesResultCache[ 'databaseNames' ][] = $database[ 'name' ];
                }
            }
        }

        return $this->queriesResultCache[ 'databaseNames' ];
    }
614740
public function toArray()
	{
		$properties = parent::toArray();

		$properties[$this->_prefix . 'refid'] = $this->getRefId();
		$properties[$this->_prefix . 'position'] = $this->getPosition();

		return $properties;
	}
791410
public static function convertToDb($value)
    {
        return $value instanceof ExtReference ?
            \MongoDBRef::create($value->getRef(), $value->getId()) :
            null;
    }
260217
public function getSetCollectionAttributes()
    {
        $category = $this->vObj->getObjectAttributeCategory();
        $values = $category->getAttributeValues($this->vObj);
        $attribs = [];
        foreach ($values as $value) {
            $attribs[] = $value->getAttributeKey();
        }

        return $attribs;
    }
617940
public function toQuery() : array
	{
		$array = [];

		foreach (get_object_vars($this) as $name => $value)
		{
			if (null === $value)
			{
				continue;
			}

			if (is_array($value))
			{
				if (count($value))
				{
					foreach ($value as $v)
					{
						$array[] = [
							'name'     => $name . '[]',
							'contents' => $v
						];
					}
				}
			}
			else
			{
				$array[] = [
					'name'     => $name,
					'contents' => $value
				];
			}
		}

		return $array;
	}
698181
protected function getCollectionFromObjectByReference()
    {
        $object       = $this->getObject();
        $refl         = $this->getClassMetadata()->getReflectionClass();
        $reflProperty = $refl->getProperty($this->getCollectionName());

        $reflProperty->setAccessible(true);

        return $reflProperty->getValue($object);
    }
1078912
def get_ref(self):
        
        _id = self.id
        if _id is None:
            return None
        else:
            return DBRef(self.collection, _id)
473660
public function getList()
    {
        $result = $this->execute();
        $list = new ArrayCollection;

        //Convert all of them to entities
        foreach ($result as $row)
        {
            $list->add($this->convertValue($row[0]));
        }

        return $list;
    }
412709
public function getResult()
    {
        $result = $this->mongo->aggregate($this->getCollectionName(), $this->getPipeline());
        return $result->toArray();
    }
43715
protected function _update_references()
  {
    foreach($this->_references as $name => $ref)
    {
      if(isset($this->_related_objects[$name]) && $this->_related_objects[$name] instanceof Mongo_Document)
      {
        $model = $this->_related_objects[$name];
        $id_field = isset($ref['field']) ? $ref['field'] : "_$name";
        if( ! $this->__isset($id_field) || $this->__get($id_field) != $model->_id)
        {
          $this->__set($id_field, $model->_id);
        }
      }
    }
  }
740755
def _get_ref(data, position, obj_end, opts, element_name):
    """"""
    collection, position = _get_string(
        data, position, obj_end, opts, element_name)
    oid, position = _get_oid(data, position, obj_end, opts, element_name)
    return DBRef(collection, oid), position
831956
public function readByReference()
    {
        $service = $this->getService();

        $response      = $service->request('customers/lookup', 'GET', '', $this->getParams());
        $responseArray = $this->getResponseArray($response);

        // a 404 will be returned if not found, so make sure we have a 200
        if (!$this->isError() && '200' == $response->getStatusCode()) {
            $this->_data = $responseArray['customer'];
        } else {
            $this->_data = array();
        }

        return $this;
    }