You are here

public function vfsStreamDirectory::getChild in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php \org\bovigo\vfs\vfsStreamDirectory::getChild()

returns the child with the given name

Parameters

string $name:

Return value

vfsStreamContent

Overrides vfsStreamContainer::getChild

1 call to vfsStreamDirectory::getChild()
vfsStreamDirectory::hasChild in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php
checks whether the container contains a child with the given name

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php, line 175

Class

vfsStreamDirectory
Directory container.

Namespace

org\bovigo\vfs

Code

public function getChild($name) {
  $childName = $this
    ->getRealChildName($name);
  foreach ($this->children as $child) {
    if ($child
      ->getName() === $childName) {
      return $child;
    }
    if ($child
      ->appliesTo($childName) === true && $child
      ->hasChild($childName) === true) {
      return $child
        ->getChild($childName);
    }
  }
  return null;
}