You are here

public static function SchemaNameBase::pivotItem in Schema.org Metatag 7

1 call to SchemaNameBase::pivotItem()
SchemaNameBase::getElement in src/SchemaNameBase.php
Get the HTML tag for this meta tag.

File

src/SchemaNameBase.php, line 153

Class

SchemaNameBase
All Schema.org tags should extend this class.

Code

public static function pivotItem($array) {

  // See if any nested items need to be pivoted.
  // If pivot is set to 0, it would have been removed as an empty value.
  if (array_key_exists('pivot', $array)) {
    unset($array['pivot']);
    $array = $this
      ->schemaMetatagManager()
      ->pivot($array);
  }
  foreach ($array as $key => &$value) {
    if (is_array($value)) {
      $value = static::pivotItem($value);
    }
  }
  return $array;
}