0
I made the following code:
<?php
//dados de um arquivo JSON
$json_str = '[ {
  "documentoId" : 1057615,
  "nome" : "1542980818602.pdf",
  "assunto" : "AQUI FICA O ASSUNTO DO DOCUMENTO",
  "dataEnvio" : "23/11/2018 10:46:58",
  "tipoDocumento" : {
    "tipoDocumentoId" : 137,
    "nome" : "Nome de um Tipo"
  },
  "link" : null
}, {
  "documentoId" : 1057748,
  "nome" : "1542983033040.pdf",
  "assunto" : "FICA AQUI OUTRO ASSUNTO",
  "dataEnvio" : "23/11/2018 11:23:53",
  "tipoDocumento" : {
    "tipoDocumentoId" : 105,
    "nome" : "Nome de Outro Tipo"
  },
  "link" : null
}, {
  "documentoId" : 1064570,
  "nome" : "1543494201384.pdf",
  "assunto" : "ESCREVO AQUI MAIS OUTRO ASSUNTO",
  "dataEnvio" : "29/11/2018 09:23:21",
  "tipoDocumento" : {
    "tipoDocumentoId" : 135,
    "nome" : "Outro Tipo Aqui"
  },
  "link" : null
}, {
  "documentoId" : 1064592,
  "nome" : "1543494685352.pdf",
  "assunto" : "OUTRO ASSUNTO ESCRITO AQUI ",
  "dataEnvio" : "29/11/2018 09:31:25",
  "tipoDocumento" : {
    "tipoDocumentoId" : 134,
    "nome" : "Mais Um Tipo"
  },
  "link" : null
} ]';
//faz o parsing na string, gerando um objeto PHP
$jsonObj = json_decode($json_str);
//navega pelos elementos do array, imprimindo os objetos
foreach ( $jsonObj as $e )
    {
        if (property_exists($e, "tipoDocumento")) { 
        $deps = $e->tipoDocumento;
        foreach ( $deps as $d );
        echo "<div>Tipo de Documento: $d - Descrição: $e->assunto - Data de envio: $e->dataEnvio - Nome: $e->nome </div>";
    }
    }
?> 
I’d like to take the value of tipoDocumento > nome. The code returns:
Is working perfectly.
But I believe that is not the correct solution to "filter" these values, because there is something that is defining that I want to take the value of tipoDocumento > nome and yet it’s being perfectly.
Notice that the same object tipoDocumento possesses within it tipoDocumentoId and nome, and yet it is ignoring and being printed the value of tipoDocumento > nome perfectly.
"tipoDocumento" : {
        "tipoDocumentoId" : 137,
        "nome" : "Nome de um Tipo"
      },
What is the correct way to take these values?
And if instead of tipoDocumento > nome I wanted to tipoDocumento > tipoDocumentoId, how would I set it?

Very interesting! =)
– Alexandre Lopes