src/action/ManageEditAction.php
public function run(Request $request) {
		$id = $this->getParam('id');
		$sport = SportQuery::create()->findOneById($id);
		$data = ['sport' => $sport];
		$payload = new Blank($data);
		if ($request->isMethod('POST')) {
			$post = $request->request;

			$domain = new SportDomain($this->getServiceContainer());
			$serializer = Sport::getSerializer();

			$fields = $serializer->getFields();
			$attribs = [];

			foreach ($fields as $field) {
				if ($post->has($field)) {
					$attribs[$field] = $post->get($field);
				}
			}

			$attribs['feature_composition'] = $post->has('feature_composition');
			$attribs['feature_tester'] = $post->has('feature_tester');

			$payload = $domain->update($id, [
				'meta' => $post->get('meta', []),
				'attributes' => $attribs
			]);
			if ($payload instanceof NotValid) {
				$payload = new NotValid(array_merge($data, $payload->get()));
			}
		}

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

			$domain = new SportDomain($this->getServiceContainer());
			$serializer = Sport::getSerializer();

			$fields = $serializer->getFields();
			$attribs = [];

			foreach ($fields as $field) {
				if ($post->has($field)) {
					$attribs[$field] = $post->get($field);
				}
			}

			$attribs['feature_composition'] = $post->has('feature_composition');
			$attribs['feature_tester'] = $post->has('feature_tester');

			$payload = $domain->update($id, [
				'meta' => $post->get('meta', []),
				'attributes' => $attribs
			]);
			if ($payload instanceof NotValid) {
				$payload = new NotValid(array_merge($data, $payload->get()));
			}
		}

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

@param Request $request
@return Response