Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ResourceObject.php

function ResourceObject::hasField

Whether the resource object has the given field.

Parameters

string $public_field_name: A public field name.

Return value

bool TRUE if the resource object has the given field, FALSE otherwise.

1 call to ResourceObject::hasField()
ResourceObject::getField in core/modules/jsonapi/src/JsonApiResource/ResourceObject.php
Gets the given field.

File

core/modules/jsonapi/src/JsonApiResource/ResourceObject.php, line 141

Class

ResourceObject
Represents a JSON:API resource object.

Namespace

Drupal\jsonapi\JsonApiResource

Code

public function hasField($public_field_name) {
    return isset($this->fields[$public_field_name]);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal