public function getComponentByName($name)
    {
        foreach ($this->getComponents() as $component) {
            if ($component->getName() === $name) {
                return $component;
            }
        }
    }
public function getComponentByName($name)
    {
        foreach ($this->getComponents() as $component) {
            if ($component->getName() === $name) {
                return $component;
            }
        }
    }
public function getComponentByName ( $ name ) { foreach ( $ this -> getComponents ( ) as $ component ) { if ( $ component -> getName ( ) === $ name ) { return $ component ; } } }
Finds child component by name.

@param string $name
@return null|ComponentInterface
Finds child component by name .