common/actions/meta/Delete.php
public function run( $cid ) {

		$parent	= $this->model;

		if( isset( $parent ) ) {

			$meta		= $this->metaService->getById( $cid );
			$belongsTo	= $meta->hasAttribute( 'modelId' ) ? $meta->belongsTo( $parent ) : $meta->belongsTo( $parent, $this->modelService->getParentType() );

			if( isset( $meta ) && $belongsTo ) {

				$this->metaService->delete( $meta );

				$data	= [ 'id' => $meta->id, 'name' => $meta->name, 'value' => $meta->value ];

				// Trigger Ajax Success
				return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
			}
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}
public function run( $cid ) {

		$parent	= $this->model;

		if( isset( $parent ) ) {

			$meta		= $this->metaService->getById( $cid );
			$belongsTo	= $meta->hasAttribute( 'modelId' ) ? $meta->belongsTo( $parent ) : $meta->belongsTo( $parent, $this->modelService->getParentType() );

			if( isset( $meta ) && $belongsTo ) {

				$this->metaService->delete( $meta );

				$data	= [ 'id' => $meta->id, 'name' => $meta->name, 'value' => $meta->value ];

				// Trigger Ajax Success
				return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
			}
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}
public function run ( $ cid ) { $ parent = $ this -> model ; if ( isset ( $ parent ) ) { $ meta = $ this -> metaService -> getById ( $ cid ) ; $ belongsTo = $ meta -> hasAttribute ( 'modelId' ) ? $ meta -> belongsTo ( $ parent ) : $ meta -> belongsTo ( $ parent , $ this -> modelService -> getParentType ( ) ) ; if ( isset ( $ meta ) && $ belongsTo ) { $ this -> metaService -> delete ( $ meta ) ; $ data = [ 'id' => $ meta -> id , 'name' => $ meta -> name , 'value' => $ meta -> value ] ; // Trigger Ajax Success return AjaxUtil :: generateSuccess ( Yii :: $ app -> coreMessage -> getMessage ( CoreGlobal :: MESSAGE_REQUEST ) , $ data ) ; } } // Trigger Ajax Failure return AjaxUtil :: generateFailure ( Yii :: $ app -> coreMessage -> getMessage ( CoreGlobal :: ERROR_NOT_FOUND ) ) ; }
Delete meta for given meta id, parent slug and parent type.
Delete meta for given meta id parent slug and parent type .