Example #1
0
 /**
  * Exports the object as an array.
  *
  * You can specify the key type of the array by passing one of the class
  * type constants.
  *
  * @param     string  $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  *                    BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  *                    Defaults to BasePeer::TYPE_PHPNAME.
  * @param     boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to true.
  * @param     array $alreadyDumpedObjects List of objects to skip to avoid recursion
  * @param     boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
  *
  * @return array an associative array containing the field names (as keys) and field values
  */
 public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
 {
     if (isset($alreadyDumpedObjects['Agenda'][$this->getPrimaryKey()])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['Agenda'][$this->getPrimaryKey()] = true;
     $keys = AgendaPeer::getFieldNames($keyType);
     $result = array($keys[0] => $this->getId(), $keys[1] => $this->getProgramacion(), $keys[2] => $this->getFechaestado(), $keys[3] => $this->getHora(), $keys[4] => $this->getHoraestado(), $keys[5] => $this->getInicio(), $keys[6] => $this->getLastTime(), $keys[7] => $this->getIngreso(), $keys[8] => $this->getSalaId(), $keys[9] => $this->getQuirofanoId(), $keys[10] => $this->getEgreso(), $keys[11] => $this->getCie9mc(), $keys[12] => $this->getCie9mcId(), $keys[13] => $this->getCxRealizada(), $keys[14] => $this->getCxRealizadaId(), $keys[15] => $this->getTipoCx(), $keys[16] => $this->getDiagnostico(), $keys[17] => $this->getDiagnosticoId(), $keys[18] => $this->getMedicoName(), $keys[19] => $this->getPacienteName(), $keys[20] => $this->getPacienteId(), $keys[21] => $this->getEdad(), $keys[22] => $this->getGenero(), $keys[23] => $this->getGeneroId(), $keys[24] => $this->getRegistro(), $keys[25] => $this->getServicio(), $keys[26] => $this->getAnestesiaId(), $keys[27] => $this->getAnestesiaEmpleada(), $keys[28] => $this->getEvAdversosAnestesia(), $keys[29] => $this->getObservaciones(), $keys[30] => $this->getRequerimiento(), $keys[31] => $this->getReqInsumos(), $keys[32] => $this->getReqHemoderiv(), $keys[33] => $this->getReqLaboratorio(), $keys[34] => $this->getReqAnestesico(), $keys[35] => $this->getStatus(), $keys[36] => $this->getCausaDiferidoId(), $keys[37] => $this->getSolicitado(), $keys[38] => $this->getRiesgoqxId(), $keys[39] => $this->getContaminacionqxId(), $keys[40] => $this->getEventoqxId(), $keys[41] => $this->getComplicaciones(), $keys[42] => $this->getValPreAnestesica(), $keys[43] => $this->getReintervencion(), $keys[44] => $this->getPermisos(), $keys[45] => $this->getTipoProcId(), $keys[46] => $this->getAtencionId(), $keys[47] => $this->getTiempoFuera(), $keys[48] => $this->getProcedencia(), $keys[49] => $this->getClasificacionqx(), $keys[50] => $this->getRegionPx(), $keys[51] => $this->getExtensionPx(), $keys[52] => $this->getAnexoDetalle(), $keys[53] => $this->getDestinoPx(), $keys[54] => $this->getLiberacionSala(), $keys[55] => $this->getTiempoEst(), $keys[56] => $this->getRiesgoQxPre(), $keys[57] => $this->getShowInIndex(), $keys[58] => $this->getProtocolo(), $keys[59] => $this->getCancelada(), $keys[60] => $this->getCreatedAt(), $keys[61] => $this->getUpdatedAt());
     if ($includeForeignObjects) {
         if (null !== $this->aSalaquirurgica) {
             $result['Salaquirurgica'] = $this->aSalaquirurgica->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aQuirofano) {
             $result['Quirofano'] = $this->aQuirofano->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aRiesgoqx) {
             $result['Riesgoqx'] = $this->aRiesgoqx->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aContaminacionqx) {
             $result['Contaminacionqx'] = $this->aContaminacionqx->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aEventoqx) {
             $result['Eventoqx'] = $this->aEventoqx->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aProcedimiento) {
             $result['Procedimiento'] = $this->aProcedimiento->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aCausadiferido) {
             $result['Causadiferido'] = $this->aCausadiferido->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aAtencion) {
             $result['Atencion'] = $this->aAtencion->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aEspecialidad) {
             $result['Especialidad'] = $this->aEspecialidad->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->collPersonalcirugias) {
             $result['Personalcirugias'] = $this->collPersonalcirugias->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collDiagnosticocirugias) {
             $result['Diagnosticocirugias'] = $this->collDiagnosticocirugias->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collProcedimientocirugias) {
             $result['Procedimientocirugias'] = $this->collProcedimientocirugias->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collProcedimientregrogramados) {
             $result['Procedimientregrogramados'] = $this->collProcedimientregrogramados->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
     }
     return $result;
 }