You are here

public function OnlyOneInterface::existsNodesContentType in Allow a content type only once (Only One) 8

Returns if exists nodes of a content type in the actual language.

Parameters

string $content_type: Content type machine name.

string $language: The language to check. If the variable is not provided and the site is multilingual the actual language will be taken.

Return value

int If exists nodes return the first node nid otherwise return 0.

1 method overrides OnlyOneInterface::existsNodesContentType()
OnlyOne::existsNodesContentType in src/OnlyOne.php
Returns if exists nodes of a content type in the actual language.

File

src/OnlyOneInterface.php, line 31

Class

OnlyOneInterface
Interface OnlyOneInterface.

Namespace

Drupal\onlyone

Code

public function existsNodesContentType($content_type, $language = NULL);