Back to ChangeItem class

Method fix

public void
fix
()
Runs the update query to apply the change to the database
Returns
  • void
Since
  • 2.5
Class: ChangeItem
Project: Joomla

Method fix - Source code

/**
 * Runs the update query to apply the change to the database
 *
 * @return  void
 *
 * @since   2.5
 */
public function fix()
{
    if ($this->checkStatus === -2) {
        // At this point we have a failed query
        $query = $this->updateQuery;
        try {
            $this->db->setQuery($query);
            $this->db->execute();
            if ($this->check()) {
                $this->checkStatus = 1;
                $this->rerunStatus = 1;
            } else {
                $this->rerunStatus = -2;
            }
        } catch (ExecutionFailureException|\RuntimeException $e) {
            $this->rerunStatus = -2;
        }
    }
}