/**
     * Update an application status model
     *
     * @param ApplicationStatusModel $model
     * @see ControllerBase::update()
     */
    public function update($model)
    {
        if ($model->validateForUpdate()) {
            try {
                $query = <<<SQL
UPDATE applicationStatus
   SET statusValue = ?
     , isActive = ?
     , sortKey = ?
     , style = ?
 WHERE id = ?
SQL;
                $id = $model->getId();
                $statusValue = $model->getStatusValue();
                $isActive = $model->getIsActive();
                $sortKey = $model->getSortKey();
                $style = $model->getStyle();
                $stmt = $this->_dbh->prepare($query);
                if (!$stmt) {
                    throw new ControllerException('Prepared statement failed for ' . $query);
                }
                if (!$stmt->bind_param('siisi', $statusValue, $isActive, $sortKey, $style, $id)) {
                    throw new ControllerException('Binding parameters for prepared statement failed.');
                }
                if (!$stmt->execute()) {
                    throw new ControllerException('Failed to execute UPDATE statement. (' . $this->_dbh->error . ')');
                }
                /**
                 * @SuppressWarnings checkAliases
                 */
                if (!$stmt->close()) {
                    throw new ControllerException('Something broke while trying to close the prepared statement.');
                }
                return $id;
            } catch (Exception $e) {
                throw new ControllerException($e->getMessage());
            }
        } else {
            throw new ControllerException("Invalid data.");
        }
    }