Change model status to Rejected

@return bool
482848
public function markRejected(): bool
    {
        $this->owner->{$this->statusAttribute} = Status::REJECTED;

        if ($this->beforeModeration()) {
            return $this->owner->save();
        }

        return false;
    }
561534
protected function performUpdate()
    {
        $params = $this->setKeysForSave();

        // If the updating event returns false, we will cancel the update operation so
        // developers can hook Validation systems into their models and cancel this
        // operation if the model does not pass validation. Otherwise, we update.
        if ($this->fireModelEvent('updating') === false) {
            return false;
        }

        // Send updates
        $results = $this->makeRequest($this->getEndpoint(), 'update', [
            $this->getKey(),
            $params
        ]);

        if ($results) {
            // Update model with new data
            $this->fill($results);

            $this->fireModelEvent('updated', false);
        }

        return true;
    }
249148
public function hasChanged()
    {
        foreach ($this->modelData as $property => $value) {
            if ($this->hasPropertyChanged($property)) {
                return true;
            }
        }

        // In case model data has been manually unset
        $manuallyUnsetProperties = array_diff_key($this->changeSnapshotData, $this->modelData);
        foreach ($manuallyUnsetProperties as $property => $value) {
            // If it wasn't null before, that's a change
            if ($value !== null) {
                return true;
            }
        }

        return false;
    }
185741
public function change()
    {
        $tableName = 'language_translations';
        if (!$this->hasTable($tableName)) {
            $tableName = 'translations';
        }

        $table = $this->table($tableName);
        if ($table->hasColumn('is_active')) {
            $table->changeColumn('is_active', 'boolean', [
                'default' => true,
                'null' => true,
            ]);
        }
        $table->update();
    }
413377
protected function validateStatusOrder()
    {
        $field = 'status';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $statuses = $this->order->getStatuses();

        if (empty($statuses[$value])) {
            $this->setErrorUnavailable($field, $this->translation->text('Status'));
            return false;
        }

        return true;
    }
564
public function revert() {
		if ($this->data()->IsModifiedOnStage) {
			$this->data()->doRevertToLive();
		}
		return $this->redirect($this->data()->Link() . '?stage=Live');
	}
975337
public function isSuccessful()
    {
        if (isset($this->data['object']) && 'transaction' === $this->data['object']) {
            return !($this->data['status'] == 'refused');
        }
        return !isset($this->data['errors']);
    }
19071
public function removeIfExpired()
    {
        if ($this->getIsExpired() && !$this->getIsNewRecord()) {
            if (($this->expiredRemovingCallback instanceof Closure || is_array($this->expiredRemovingCallback)) && is_callable($this->expiredRemovingCallback)) {
                call_user_func($this->expiredRemovingCallback, $this);
            }
            $result = $this->removeSelf();
            $this->trigger(static::$eventExpiredRemoved, new ModelEvent(['data' => ['result' => $result]]));
            return true;
        }
        return false;
    }
133984
public function reject()
    {
      $url = URIResource::Make($this->path, array($this->id));
      $data = new DataPacket(array("state" => CALL_STATES::rejected));
      $this->client->post($url, $data->get());

      return Constructor::Make($this, $data->get());
    }
133510
public function rollback()
    {
        if (!Scaffoldinterface::all()->count()) {
            Session::flash('status', 'Nothing To Rollback');

            return redirect('scaffold');
        }

        try {
            Artisan::call('migrate:rollback');
        } catch (\Exception $e) {
            return $e->getMessage();
        }
        $Msg = str_replace("\n", '', Artisan::output());
        Session::flash('status', $Msg);

        return redirect('scaffold');
    }
20527
public function accept()
    {
        if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) {
            return false;
        }

        if ($this->excludedPattern) {
            $path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath();
            $path = str_replace('\\', '/', $path);

            return !preg_match($this->excludedPattern, $path);
        }

        return true;
    }
245398
public function reindexImportedCategories()
    {
        switch ($this->getBehavior()) {
            case Import::BEHAVIOR_DELETE:
                $this->indexDeleteEvents();
                break;
            case Import::BEHAVIOR_REPLACE:
            case Import::BEHAVIOR_APPEND:
            case Import::BEHAVIOR_ADD_UPDATE:

                $this->reindexUpdatedCategories();
                break;
            default:
                throw new \Exception('Unsupported Mode!');
                break;
        }
        return $this;
    }
275501
public function down()
    {
        if (Config::get('database')['default'] === 'mysql') {
            DB::statement('alter table ab_events change column instance_id instance_id varchar(255)');
            DB::statement('alter table ab_events change column experiments_id experiments_id varchar(255)');
    
            DB::statement('alter table ab_goal change column instance_id instance_id varchar(255)');
            
        } else if (Config::get('database')['default'] === 'pgsql') {
            DB::statement('alter table ab_events alter column instance_id type varchar using (instance_id::varchar)');
            DB::statement('alter table ab_events alter column experiments_id type varchar using (experiments_id::varchar)');
        
            DB::statement('alter table ab_goal alter column instance_id type varchar using (instance_id::varchar)');
        }
        
        DB::connection()->getPdo()->exec("delete from migrations where migration = '2016_10_12_000001_fix_ab_column_types'");
        
        return true;
    }
958887
public function revert()
    {
        $model = $this->getModel();
        unset( $model->{$model->getCreatedAtColumn()} );
        unset( $model->{$model->getUpdatedAtColumn()} );
        if (method_exists($model, 'getDeletedAtColumn')) {
            unset( $model->{$model->getDeletedAtColumn()} );
        }
        $model->save();
        return $model;
    }
862206
protected function isSorted()
    {
        $this->sort = app('request')->get($this->grid->model()->getSortName());

        if (empty($this->sort)) {
            return false;
        }

        return isset($this->sort['column']) && $this->sort['column'] == $this->name;
    }
1221613
public function change()
    {
        $tableName = 'language_translations';
        if (!$this->hasTable($tableName)) {
            $tableName = 'translations';
        }

        $table = $this->table($tableName);
        if (!$table->hasColumn('is_active')) {
            $table->addColumn('is_active', 'boolean', [
                'default' => 0,
                'null' => false,
            ]);
        }
        $table->update();
    }
514619
public function toggleStatus()
    {
        $messageMapper = ($this->container->dataMapper)('MessageMapper');

        $messageId = $this->request->getParsedBodyParam('id');
        $message = $messageMapper->findById($messageId);
        if ($message->isRead === 'Y') {
            $messageMapper->markAsUnread($messageId);
        } else {
            $messageMapper->markAsRead($messageId);
        }

        // Set the response type
        if ($this->request->isXhr()) {
            $r = $this->response->withHeader('Content-Type', 'application/json');
            return $r->write(json_encode(["status" => "success"]));
        }

        return $this->redirect('adminMessages');
    }