src/action/ManageDefaultAction.php
public function run(Request $request) {
		$sport = SportQuery::create()->findOneById($this->getParam('id'));

		if ($sport !== null) {
			$default = SportQuery::create()->findOneByIsDefault(true);
			$default->setIsDefault(false);
			$default->save();

			if ($sport->getId() != $default->getId()) {
				$sport->setIsDefault(true);
				$sport->save();
			}
		}

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

		if ($sport !== null) {
			$default = SportQuery::create()->findOneByIsDefault(true);
			$default->setIsDefault(false);
			$default->save();

			if ($sport->getId() != $default->getId()) {
				$sport->setIsDefault(true);
				$sport->save();
			}
		}

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

@param Request $request
@return Response