You are here

protected function PrivateItemList::checkTypeSetting in Private content 8.2

Get the node's content type setting and check against the listed values.

Parameters

boolean $value1: First value to check against

boolean $value2: Second value to check against

Return value

boolean True if type setting matches one of the values.

2 calls to PrivateItemList::checkTypeSetting()
PrivateItemList::getDefault in src/Plugin/Field/FieldType/PrivateItemList.php
Return default value of private field, based on the node's content type.
PrivateItemList::isLocked in src/Plugin/Field/FieldType/PrivateItemList.php
Return whether private field is locked (not-writeable), based on the node's content type.

File

src/Plugin/Field/FieldType/PrivateItemList.php, line 69

Class

PrivateItemList
List class for PrivateItem.

Namespace

Drupal\private_content\Plugin\Field\FieldType

Code

protected function checkTypeSetting($value1, $value2) {

  /** @var \Drupal\node\NodeTypeInterface $type */
  $type = $this
    ->getEntity()->type->entity;
  $type_setting = $type
    ->getThirdPartySetting('private_content', 'private', PRIVATE_ALLOWED);
  return $type_setting == $value1 || $type_setting == $value2;
}