common/services/traits/base/ApprovalTrait.php
public function toggleBlock( $model, $notify = true, $config = [] ) {

		$oldStatus = $model->getStatusStr();

		$model->toggleBlock();
		$model->save();

		$newStatus = $model->getStatusStr();

		if( $notify ) {

			$title = $model->isActive( true ) ? $model->getClassName() . ' Activated' : $model->getClassName() . ' Blocked';

			$config[ 'template' ] = $model->isActive( true ) ? CoreGlobal::TPL_NOTIFY_STATUS_ACTIVE : CoreGlobal::TPL_NOTIFY_STATUS_BLOCK;

			$config[ 'data' ][ 'oldStatus' ] = $oldStatus;
			$config[ 'data' ][ 'newStatus' ] = $newStatus;

			$this->notifyUser( $model, $config, $title );
		}

		return $model;
	}
public function toggleBlock( $model, $notify = true, $config = [] ) {

		$oldStatus = $model->getStatusStr();

		$model->toggleBlock();
		$model->save();

		$newStatus = $model->getStatusStr();

		if( $notify ) {

			$title = $model->isActive( true ) ? $model->getClassName() . ' Activated' : $model->getClassName() . ' Blocked';

			$config[ 'template' ] = $model->isActive( true ) ? CoreGlobal::TPL_NOTIFY_STATUS_ACTIVE : CoreGlobal::TPL_NOTIFY_STATUS_BLOCK;

			$config[ 'data' ][ 'oldStatus' ] = $oldStatus;
			$config[ 'data' ][ 'newStatus' ] = $newStatus;

			$this->notifyUser( $model, $config, $title );
		}

		return $model;
	}
public function toggleBlock ( $ model , $ notify = true , $ config = [ ] ) { $ oldStatus = $ model -> getStatusStr ( ) ; $ model -> toggleBlock ( ) ; $ model -> save ( ) ; $ newStatus = $ model -> getStatusStr ( ) ; if ( $ notify ) { $ title = $ model -> isActive ( true ) ? $ model -> getClassName ( ) . ' Activated' : $ model -> getClassName ( ) . ' Blocked' ; $ config [ 'template' ] = $ model -> isActive ( true ) ? CoreGlobal :: TPL_NOTIFY_STATUS_ACTIVE : CoreGlobal :: TPL_NOTIFY_STATUS_BLOCK ; $ config [ 'data' ] [ 'oldStatus' ] = $ oldStatus ; $ config [ 'data' ] [ 'newStatus' ] = $ newStatus ; $ this -> notifyUser ( $ model , $ config , $ title ) ; } return $ model ; }
Toggle the model between Blocked and Active states.

@param \cmsgears\core\common\models\interfaces\base\IApproval $model
@param boolean $notify
@param array $config
@return \cmsgears\core\common\models\interfaces\base\IApproval
Toggle the model between Blocked and Active states .