implements Phalcon\Mvc\Model\MessageInterface
Encapsulates validation info generated before save/delete records fails
use Phalcon\Mvc\Model\Message as Message; class Robots extends \Phalcon\Mvc\Model { public function beforeSave() { if ($this->name == 'Peter') { $text = "A robot cannot be named Peter"; $field = "name"; $type = "InvalidValue"; $message = new Message($text, $field, $type); $this->appendMessage($message); } } }
Phalcon\Mvc\Model\Message constructor
Sets message type
Returns message type
Sets verbose message
Returns verbose message
Sets field name related to message
Returns field name related to message
Set the model who generates the message
Sets code for the message
Returns the model that produced the message
Returns the message code
Magic __toString method returns verbose message
Magic __set_state helps to re-build messages variable exporting
© 2011–2016 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/latest/api/Phalcon_Mvc_Model_Message.html