Plugin/Lyrics/Controller/SongsController.php
/**
 * delete method
 *
 * @throws NotFoundException
 * @throws MethodNotAllowedException
 * @param string $id
 * @return void
 */
delete method
@throws NotFoundException
@throws MethodNotAllowedException
@param string $id
@return void
delete method @throws NotFoundException @throws MethodNotAllowedException @param string $id @return void
public function delete($id = null) {
		$this->layout = false;
		$this->Song->id = $id;
		if (!$this->Song->exists()) {
			$response = array('message' => 'Song does not exist');
		}
		if ($this->Song->delete()) {
		$response = array('status' => 'success', 'message' => 'Song successfully deleted');
		}else {
			$response = array('status' => 'failed', 'message' => 'Song failed to be deleted');
		}
		echo json_encode($response);
	}
public function delete ( $ id = null ) { $ this -> layout = false ; $ this -> Song -> id = $ id ; if ( ! $ this -> Song -> exists ( ) ) { $ response = array ( 'message' => 'Song does not exist' ) ; } if ( $ this -> Song -> delete ( ) ) { $ response = array ( 'status' => 'success' , 'message' => 'Song successfully deleted' ) ; } else { $ response = array ( 'status' => 'failed' , 'message' => 'Song failed to be deleted' ) ; } echo json_encode ( $ response ) ; }
delete method
 @throws NotFoundException
 @throws MethodNotAllowedException
 @param string $id
 @return void
delete method @throws NotFoundException @throws MethodNotAllowedException @param string $id @return void