Manager/AbstractManager.php
protected function prepareDocumentForGet(AbstractDocument $entity): bool
    {
        $document = $entity->getMongoDocument();

        if (!$document or empty($document)) {
            return true;
        }

        foreach ($document as $key => $value) {
            if ($value instanceof BSONDocument) {
                $value = $value->getArrayCopy();
            }
            if (is_array($value) and array_key_exists('document_serialization', $value)){
                $documentEntity = $this->loadDocumentSerializedEntity($value);

                $entity->__set($key, $documentEntity);
            }
        }

        return true;
    }
protected function prepareDocumentForGet(AbstractDocument $entity): bool
    {
        $document = $entity->getMongoDocument();

        if (!$document or empty($document)) {
            return true;
        }

        foreach ($document as $key => $value) {
            if ($value instanceof BSONDocument) {
                $value = $value->getArrayCopy();
            }
            if (is_array($value) and array_key_exists('document_serialization', $value)){
                $documentEntity = $this->loadDocumentSerializedEntity($value);

                $entity->__set($key, $documentEntity);
            }
        }

        return true;
    }
protected function prepareDocumentForGet ( AbstractDocument $ entity ) : bool { $ document = $ entity -> getMongoDocument ( ) ; if ( ! $ document or empty ( $ document ) ) { return true ; } foreach ( $ document as $ key => $ value ) { if ( $ value instanceof BSONDocument ) { $ value = $ value -> getArrayCopy ( ) ; } if ( is_array ( $ value ) and array_key_exists ( 'document_serialization' , $ value ) ) { $ documentEntity = $ this -> loadDocumentSerializedEntity ( $ value ) ; $ entity -> __set ( $ key , $ documentEntity ) ; } } return true ; }
Prepares a document from MongoDB to be gotten

@param AbstractDocument $entity

@return bool
Prepares a document from MongoDB to be gotten