isCandidateDefinitionReferenceProperty example

// JSON:API outputs entity reference field properties under a meta object       // on a relationship. If the filter specifies one of these properties, it       // must prefix the property name with `meta`. The only exception is if the       // next path part is the same as the name for the reference property       // (typically `entity`), this is permitted to disambiguate the case of a       // field name on the target entity which is the same a property name on       // the entity reference field.       if ($at_least_one_entity_reference_field && $parts[0] !== 'id') {
        if ($parts[0] === 'meta') {
          array_shift($parts);
        }
        elseif (in_array($parts[0]$candidate_property_names) && !static::isCandidateDefinitionReferenceProperty($parts[0]$candidate_definitions)) {
          throw new CacheableBadRequestHttpException($cacheabilitysprintf('Invalid nested filtering. The property `%s`, given in the path `%s` belongs to the meta object of a relationship and must be preceded by `meta`.', $parts[0]$external_field_name));
        }
      }

      // Determine if the next part is not a property of $field_name.       if (!static::isCandidateDefinitionProperty($parts[0]$candidate_definitions) && !empty(static::getAllDataReferencePropertyNames($candidate_definitions))) {
        // The next path part is neither a delta nor a field property, so it         // must be a field on a targeted resource type. We need to guess the         // intermediate reference property since one was not provided.         //         // For example, the path `uid.name` for a `node--article` resource type
Home | Imprint | This part of the site doesn't use cookies.