Hey,
I want to know if it's possible to get directly all field of a foreign key. e.g
If I use findFirst I can do that :
$robot = Robots::findFirst(array(
"conditions" => "id IN :id:",
"bind" => array("id" => 1)
));
$partsName = $robot->getRobotsParts()->name;
But if I use a find I have to do that :
$data = array()
$robots = Robots::findFirst()
foreach ($robots as $robot) {
$data['id'] = $robot->id;
$data['partsName'] = $robot->getRobotsParts()->name;
}
But there is something to do that :
$robots = Robots::find(array(
"columns" => "id, parts_name" // But in my Robots model I have just the `id_parts`. parts_name is in the parts table
));
echo $robots->toArray();
It's possible to select directly the parts_name column ?