code: protected function extractIdFrom(EnvironmentInterface $environment, $parameterName = 'pid')
      {
          $parameter = $environment->getInputProvider()->getParameter($parameterName);
  
          return ModelId::fromSerialized($parameter)->getId();
      }
docs: Extract the id value from the serialized parameter with the given name.
  
  @param EnvironmentInterface $environment   The environment.
  
  @param string               $parameterName The parameter name containing the id.
  
  @return int