original_string: public function findComponentByHandler($handler)
      {
          foreach ($this->page->components as $component) {
              if ($component->methodExists($handler)) {
                  return $component;
              }
          }
  
          foreach ($this->layout->components as $component) {
              if ($component->methodExists($handler)) {
                  return $component;
              }
          }
  
          return null;
      }
code: public function findComponentByHandler($handler)
      {
          foreach ($this->page->components as $component) {
              if ($component->methodExists($handler)) {
                  return $component;
              }
          }
  
          foreach ($this->layout->components as $component) {
              if ($component->methodExists($handler)) {
                  return $component;
              }
          }
  
          return null;
      }
code_tokens: public function findComponentByHandler ( $ handler ) { foreach ( $ this -> page -> components as $ component ) { if ( $ component -> methodExists ( $ handler ) ) { return $ component ; } } foreach ( $ this -> layout -> components as $ component ) { if ( $ component -> methodExists ( $ handler ) ) { return $ component ; } } return null ; }
docstring: Searches the layout and page components by an AJAX handler
  @param string $handler
  @return ComponentBase The component object, if found
docstring_tokens: Searches the layout and page components by an AJAX handler