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"; $code = 103; $message = new Message($text, $field, $type, $code); $this->appendMessage($message); } } }
Phalcon\Mvc\Model\Message constructor
Sets message type
Returns message type
Sets message code
Returns message code
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
Returns the model that produced the message
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/2.0.0/api/Phalcon_Mvc_Model_Message.html