code: protected function getMetaModelByModelPid(ModelInterface $model)
      {
          $metaModel = $this
              ->factory
              ->getMetaModel(
                  $this->factory->translateIdToMetaModelName($model->getProperty('pid'))
              );
  
          if ($metaModel === null) {
              throw new \InvalidArgumentException('Could not retrieve MetaModel ' . $model->getProperty('pid'));
          }
  
          return $metaModel;
      }
docs: Get the MetaModel instance referenced in the pid property of the Model.
  
  @param ModelInterface $model The model.
  
  @return IMetaModel
  
  @throws \InvalidArgumentException When the MetaModel could not be retrieved.