function DisplayManager::item

Same name in other branches
  1. 8.x-1.x phpunit_example/src/DisplayManager.php \Drupal\phpunit_example\DisplayManager::item()
  2. 4.0.x modules/phpunit_example/src/DisplayManager.php \Drupal\phpunit_example\DisplayManager::item()

Find an item by its name.

Parameters

string $name: The name to find.

Return value

DisplayInfoInterface|null The found item, or NULL if none is found.

File

modules/phpunit_example/src/DisplayManager.php, line 66

Class

DisplayManager
An example class to demonstrate unit testing.

Namespace

Drupal\phpunit_example

Code

public function item($name) {
    if (isset($this->items[$name])) {
        return $this->items[$name];
    }
    return NULL;
}