public function hasComponentType($class_name) {
    /** @var \ChapterThree\AppleNewsAPI\Document\Components\Component $comp */
    foreach ($this->components as $comp) {
      if ($comp instanceof $class_name) {
        return TRUE;
      }
      if ($comp instanceof ComponentNested) {
        /** @var \ChapterThree\AppleNewsAPI\Document\Components\ComponentNested $comp */
        if ($comp->hasComponentType($class_name)) {
          return TRUE;
        }
      }
    }
    return FALSE;
  }
public function hasComponentType($class_name) {
    /** @var \ChapterThree\AppleNewsAPI\Document\Components\Component $comp */
    foreach ($this->components as $comp) {
      if ($comp instanceof $class_name) {
        return TRUE;
      }
      if ($comp instanceof ComponentNested) {
        /** @var \ChapterThree\AppleNewsAPI\Document\Components\ComponentNested $comp */
        if ($comp->hasComponentType($class_name)) {
          return TRUE;
        }
      }
    }
    return FALSE;
  }
public function hasComponentType ( $ class_name ) { /** @var \ChapterThree\AppleNewsAPI\Document\Components\Component $comp */ foreach ( $ this -> components as $ comp ) { if ( $ comp instanceof $ class_name ) { return TRUE ; } if ( $ comp instanceof ComponentNested ) { /** @var \ChapterThree\AppleNewsAPI\Document\Components\ComponentNested $comp */ if ( $ comp -> hasComponentType ( $ class_name ) ) { return TRUE ; } } } return FALSE ; }
Component has a child of a certain type.
Component has a child of a certain type .