Class Phalcon\Mvc\Model\Query\Status

implements Phalcon\Mvc\Model\Query\StatusInterface

This class represents the status returned by a PHQL statement like INSERT, UPDATE or DELETE. It offers context information and the related messages produced by the model which finally executes the operations when it fails

  1. <?php
  2. $phql = "UPDATE Robots SET name = :name:, type = :type:, year = :year: WHERE id = :id:";
  3. $status = $app->modelsManager->executeQuery($phql, array(
  4. 'id' => 100,
  5. 'name' => 'Astroy Boy',
  6. 'type' => 'mechanical',
  7. 'year' => 1959
  8. ));
  9. \//Check if the update was successful
  10. if ($status->success() == true) {
  11. echo 'OK';
  12. }

Methods

public __construct (unknown $success, [unknown $model])

public Phalcon\Mvc\ModelInterface getModel ()

Returns the model that executed the action

public Phalcon\Mvc\Model\MessageInterface [] getMessages ()

Returns the messages produced because of a failed operation

public boolean success ()

Allows to check if the executed operation was successful