src/action/ManageDeleteAction.php
public function run(Request $request) {
		$id = $this->getParam('id');
		$sport = SportQuery::create()->findOneById($id);
		$data = ['sport' => $sport];
		$payload = null;

		if ($request->isMethod('POST')) {
			if ($request->request->get('name') == $sport->getTitle()) {
				$sport->delete();
				$payload = new Success();
			} else {
				$data['error'] = 'Name is wrong';
			}
		}

		if ($payload === null) {
			$payload = new Blank($data);
		}

		return $this->responder->run($request, $payload);
	}
public function run(Request $request) {
		$id = $this->getParam('id');
		$sport = SportQuery::create()->findOneById($id);
		$data = ['sport' => $sport];
		$payload = null;

		if ($request->isMethod('POST')) {
			if ($request->request->get('name') == $sport->getTitle()) {
				$sport->delete();
				$payload = new Success();
			} else {
				$data['error'] = 'Name is wrong';
			}
		}

		if ($payload === null) {
			$payload = new Blank($data);
		}

		return $this->responder->run($request, $payload);
	}
Automatically generated run method

@param Request $request
@return Response