You are here

static function SearchApiEtHelper::isValidItemId in Search API Entity Translation 7.2

Helper function to check if the given $item_id is valid.

Parameters

$item_id: The Item ID (in the form "{entity_id}/{language}")

Return value

bool

7 calls to SearchApiEtHelper::isValidItemId()
SearchApiEtDatasourceController::getMetadataWrapper in includes/SearchApiEtDatasourceController.php
Creates a metadata wrapper for this datasource controller's type.
SearchApiEtDatasourceController::getTrackableItemIdsFromMixedSource in includes/SearchApiEtDatasourceController.php
Helper function to return the list of ItemIDs, fiven
SearchApiEtDatasourceController::loadItems in includes/SearchApiEtDatasourceController.php
Loads items of the type of this data source controller.
SearchApiEtDatasourceController::trackItemDelete in includes/SearchApiEtDatasourceController.php
Stops tracking the index status for the given items on the given indexes.
SearchApiEtHelper::splitItemId in includes/SearchApiEtHelper.php
Helper function to split the Item ID into language or entity_id.

... See full list

File

includes/SearchApiEtHelper.php, line 32
Helper class for SearchAPI ET

Class

SearchApiEtHelper
@file Helper class for SearchAPI ET

Code

static function isValidItemId($item_id) {

  // Check if the entity_id is not empty: '/' position must be 1 or more.
  if (!is_string($item_id)) {
    return FALSE;
  }
  $id = trim($item_id);
  return !empty($id) && strlen($id) >= 3 && strpos($item_id, self::ITEM_ID_SEPARATOR) > 0;
}