common/services/base/ActiveRecordService.php
public function delete( $model, $config = [] ) {

		$hard	= $config[ 'hard' ] ?? true;
		$notify = $config[ 'notify' ] ?? true;

		if( isset( $model ) ) {

			// Permanent Delete
			if( $hard ) {

				return $model->delete();
			}
			// Soft Delete - Useful for models using status to mark model as deleted, but keep for historic purpose.
			else {

				$interfaces = class_implements( static::class );

				if( isset( $interfaces[ 'cmsgears\core\common\services\interfaces\base\IApproval' ] ) ) {

					// Approval Trait
					return $this->softDeleteNotify( $model, $notify, $config );
				}
				else {

					return $this->softDelete( $model );
				}
			}
		}

		return false;
	}
public function delete( $model, $config = [] ) {

		$hard	= $config[ 'hard' ] ?? true;
		$notify = $config[ 'notify' ] ?? true;

		if( isset( $model ) ) {

			// Permanent Delete
			if( $hard ) {

				return $model->delete();
			}
			// Soft Delete - Useful for models using status to mark model as deleted, but keep for historic purpose.
			else {

				$interfaces = class_implements( static::class );

				if( isset( $interfaces[ 'cmsgears\core\common\services\interfaces\base\IApproval' ] ) ) {

					// Approval Trait
					return $this->softDeleteNotify( $model, $notify, $config );
				}
				else {

					return $this->softDelete( $model );
				}
			}
		}

		return false;
	}
public function delete ( $ model , $ config = [ ] ) { $ hard = $ config [ 'hard' ] ?? true ; $ notify = $ config [ 'notify' ] ?? true ; if ( isset ( $ model ) ) { // Permanent Delete if ( $ hard ) { return $ model -> delete ( ) ; } // Soft Delete - Useful for models using status to mark model as deleted, but keep for historic purpose. else { $ interfaces = class_implements ( static :: class ) ; if ( isset ( $ interfaces [ 'cmsgears\core\common\services\interfaces\base\IApproval' ] ) ) { // Approval Trait return $ this -> softDeleteNotify ( $ model , $ notify , $ config ) ; } else { return $ this -> softDelete ( $ model ) ; } } } return false ; }
Delete the model by deleting related resources and mapper.

@param type $model
@param type $config
@return boolean
Delete the model by deleting related resources and mapper .