Mvc\Model::getMessages

public getMessages ([mixed $filter])

Returns array of validation messages

$robot = new Robots();
$robot->type = 'mechanical';
$robot->name = 'Astro Boy';
$robot->year = 1952;
if ($robot->save() == false) {
    echo "Umh, We can't store robots right now ";
    foreach ($robot->getMessages() as $message) {
            echo $message;
    }
} else {
    echo "Great, a new robot was saved successfully!";
}
doc_Phalcon
2016-10-16 09:52:51
Comments
Leave a Comment

Please login to continue.