/**
  * Allow fallback to "dataId" or "id" in case no attribute is found
  *
  * @param Request        $request
  * @param ParamConverter $configuration
  * @return string
  */
 protected function getRequestAttributeName(Request $request, ParamConverter $configuration)
 {
     $param = parent::getRequestAttributeName($request, $configuration);
     if (!$request->attributes->has($param)) {
         if ($request->attributes->has('dataId')) {
             $param = 'dataId';
         } elseif ($request->attributes->has('id')) {
             $param = 'id';
         }
     }
     return $param;
 }
 /**
  * Stores the object in the request.
  *
  * @param Request        $request       The request
  * @param ParamConverter $configuration Contains the name, class and options of the object
  *
  * @return bool True if the object has been successfully set, else false
  * @throws \InvalidArgumentException
  */
 public function apply(Request $request, ParamConverter $configuration)
 {
     $originalName = $configuration->getName();
     if ($request->attributes->has('familyCode')) {
         $configuration->setName('familyCode');
     }
     if (!parent::apply($request, $configuration)) {
         return false;
     }
     if ($originalName !== $configuration->getName()) {
         $request->attributes->set($originalName, $request->attributes->get($configuration->getName()));
     }
     return true;
 }