public function getComponentsFlattened() {
    $components = [];
    foreach ($this->getComponents() as $component) {
      $components[] = $component;
      if ($component instanceof ComponentNested) {
        /** @var \ChapterThree\AppleNewsAPI\Document\Components\ComponentNested $component */
        $descendants = $component->getComponentsFlattened();
        array_merge($components, $descendants);
      }
    }
    return $components;
  }
public function getComponentsFlattened() {
    $components = [];
    foreach ($this->getComponents() as $component) {
      $components[] = $component;
      if ($component instanceof ComponentNested) {
        /** @var \ChapterThree\AppleNewsAPI\Document\Components\ComponentNested $component */
        $descendants = $component->getComponentsFlattened();
        array_merge($components, $descendants);
      }
    }
    return $components;
  }
public function getComponentsFlattened ( ) { $ components = [ ] ; foreach ( $ this -> getComponents ( ) as $ component ) { $ components [ ] = $ component ; if ( $ component instanceof ComponentNested ) { /** @var \ChapterThree\AppleNewsAPI\Document\Components\ComponentNested $component */ $ descendants = $ component -> getComponentsFlattened ( ) ; array_merge ( $ components , $ descendants ) ; } } return $ components ; }
Gets nested components as a flattened list.

@return array
List of \ChapterThree\AppleNewsAPI\Document\Components\Component.
Gets nested components as a flattened list .