Hi all, I have a problem with this simple code below.
$application->post('/group/', function() use ($application){
// Get Json
$group = $application->request->getJsonRawBody();
$query = "INSERT INTO Group (group_name) VALUES (:group_name:)";
$status = $application->modelsManager->executeQuery($query,array(
'group_name' => $group->group_name // #### FIRST WARNING
));
$response = new Response();
if ($status->success() == true){ //#### SECOND WARNING
$response->setStatusCode(201, "Created");
} else {
$group->id = $status->getModel()->id; //#### THIRD WARNING
$response->setJsonContent(array(
'status' => 'OK',
'data' => $group
));
}
});
There are exactly three warnings:
- Field group_name not found in class bool
- Method success not found in class Mvc/Model/Query
- Method getModel not found in class Mvc/Model/Query
I don't know if I have installation or configuration problems with phalcon or phpstorm but this problem joins the one I posted yesterday here: https://forum.phalcon.io/discussion/8269/model-class-must-be-declared-abstract