Select * with joins includes


#1

Hi!
i need help … in my query result from this object:
$acciones = $this->find()
->where($conditions)
->order($order)
->join([
[
“table” => “general_user_maestro_cliente_sistemas”,
“alias” => “GeneralUserMaestroClienteSistemas”,
“conditions” =>“GeneralUserMaestroClienteSistemas.general_user_maestro_cliente_id = GeneralUserMaestroClientes.id”
],
[
“table” => “general_sistemas”,
“alias” => “GeneralSistemas”,
“conditions” =>“GeneralUserMaestroClienteSistemas.general_sistema_id = GeneralSistemas.id”
],
[
“table” => “general_sistema_plantillas”,
“alias” => “GeneralSistemaPlantillas”,
“conditions” =>“GeneralUserMaestroClienteSistemas.general_sistema_plantilla_id = GeneralSistemaPlantillas.id”
],
[
“table” => “general_sistema_accion_plantillas”,
“alias” => “GeneralSistemaAccionPlantillas”,
“conditions” =>“GeneralSistemaPlantillas.id = GeneralSistemaAccionPlantillas.general_sistema_plantilla_id”
],
[
“table” => “general_sistema_acciones”,
“alias” => “GeneralSistemaAcciones”,
“conditions” =>“GeneralSistemaAccionPlantillas.general_sistema_accion_id = GeneralSistemaAcciones.id”
],
[
“table” => “general_sistema_submodulos”,
“alias” => “GeneralSistemaSubmodulos”,
“conditions” =>“GeneralSistemaSubmodulos.id = GeneralSistemaAcciones.general_sistema_submodulo_id”
],
[
“table” => “general_sistema_modulos”,
“alias” => “GeneralSistemaModulos”,
“conditions” =>“GeneralSistemaModulos.id = GeneralSistemaSubmodulos.general_sistema_modulo_id”
]
])
;

how get all result include joins?

->select(*) // this is database error…

im sorry my english because i am from spanish language!


#2

try using select(“ALL”)


#3

Don’t use “hard-coded” joins, use the ORM association feature.