code: private function getFieldWithId(string $name, string $locale = null)
      {
          if ('Id' !== \mb_substr($name, -2)) {
              return null;
          }
  
          $field = $this->sys->getContentType()->getField(\mb_substr($name, 0, -2), true);
          if (!$field) {
              return null;
          }
  
          if ('Link' !== $field->getType() && ('Array' !== $field->getType() || 'Link' !== $field->getItemsType())) {
              return null;
          }
  
          $value = $this->getUnresolvedField($field, $locale);
          if ($value instanceof Link) {
              return $value->getId();
          }
  
          return \array_map(function (Link $link) {
              return $link->getId();
          }, $value);
      }
docs: Checks whether the given $name parameter corresponds to an attempt
  of fetching the ID of a link (or array of links).
  
  @param string      $name
  @param string|null $locale
  
  @return string|string[]|null Returns null if $name is not a valid field ID string