2017-11-29 1 views
1

내가 원하는 인쇄 :어떻게이 값에 액세스 할 수 있습니까? PHP

Object ( 
    [queryLocator] => [done] => 1 [records] => Array ( 
      [0] => SObject Object (
       [type] => 
        Cita__c [fields] => stdClass Object 
        ( 
         [Nombre_del_paciente__c] => 0030O000021cPBuQAM 
         [Fecha_de_la_cita__c] => 2017-11-28 
         [Hora_de_la_cita__c] => 15:30 
        ) 
       [Id] => a000O00000tmZH6QAM 
      ) 
    ) [size] => 1 
) 

내가 이렇게 내가 할 수있는 ID 값에 대한 액세스 ...하지만 난 캔트 acceso 다른 값 :이 print_r($response); 결과가 Id, Nombre_del_paciente__c, Fecha_de_la_cita__cHora_de_la_cita__c

입니다 :

<table> 
           <tr> 
            <th>ID </th> 
            <th>Nombre_del_paciente__c</th> 
            <th>Fecha_de_la_cita__c</th> 
            <th>Hora_de_la_cita__c</th> 
           </tr> 
           <?php 
            foreach ($response->records as $record) { 
             echo '<tr> 
                <td>'.$record->Id.'</td> 
                <td></td> 
                <td></td> 
                <td></td> 
              </tr>'; 
            } 
           ?> 
          </table> 

임 수행하려고 :

$record->type->Nombre_del_paciente__c 
$record->Cita__c ->Nombre_del_paciente__c 
$record->Cita__c['fields'] ->Nombre_del_paciente__c 

값에 액세스 할 수 없습니다.

+1

시도'$ 기록 -> 타입 -> 필드 -> Nombre_del_paciente__c' –

+0

임하려고 시도 ...하지만 일을 해달라고 할 수 있습니다 –

답변

1

키 '유형'이 개체 배열이 아닙니다. 당신은 this-

$record->type['fields']->Nombre_del_paciente__c 
$record->type['fields']->Fecha_de_la_cita__c 
$record->type['fields']->Hora_de_la_cita__c 
관련 문제