I'm such an idiot. I swear I read the docs searching for this and couldn't find it. And then I saw this:
$phql = "INSERT INTO Robots (name, type, year) VALUES (:name:, :type:, :year:)";
$status = $app->modelsManager->executeQuery($phql, array(
'name' => $robot->name,
'type' => $robot->type,
'year' => $robot->year
));
// Create a response
$response = new Response();
// Check if the insertion was successful
if ($status->success() == true) {
// Change the HTTP status
$response->setStatusCode(201, "Created");
$robot->id = $status->getModel()->id;
so, yeah, Its [response]->getModel()->[idfield].
Anyway, Thought I'd respond this in case anyone was searching for this in the future.
By the by, If you can use models (unlike me) It's even easier:
$robot->save();
echo "The generated id is: ", $robot->id;
Phalcon automatically fills the id field after calling the method save.