You are here

public function ResourceFieldResource::isInstanceOf in RESTful 7.2

Checks if the decorated object is an instance of something.

Parameters

string $class: Class or interface to check the instance.

Return value

bool TRUE if the decorated object is an instace of the $class. FALSE otherwise.

Overrides ExplorableDecoratorInterface::isInstanceOf

1 call to ResourceFieldResource::isInstanceOf()
ResourceFieldResource::getTargetColumn in src/Plugin/resource/Field/ResourceFieldResource.php
Gets the table column for joins.

File

src/Plugin/resource/Field/ResourceFieldResource.php, line 415
Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldResource.

Class

ResourceFieldResource

Namespace

Drupal\restful\Plugin\resource\Field

Code

public function isInstanceOf($class) {
  if ($this instanceof $class || $this->decorated instanceof $class) {
    return TRUE;
  }

  // Check if the decorated resource is also a decorator.
  if ($this->decorated instanceof ExplorableDecoratorInterface) {
    return $this->decorated
      ->isInstanceOf($class);
  }
  return FALSE;
}