original_string: public function getPatternMatchSites($pattern, $limit = false)
      {
          $ids = $this->getSitesIdWithAtLeastViewAccess();
          if (empty($ids)) {
              return array();
          }
  
          $sites = $this->getModel()->getPatternMatchSites($ids, $pattern, $limit);
  
          foreach ($sites as &$site) {
              $this->enrichSite($site);
          }
  
          $sites = Site::setSitesFromArray($sites);
  
          return $sites;
      }
code: public function getPatternMatchSites($pattern, $limit = false)
      {
          $ids = $this->getSitesIdWithAtLeastViewAccess();
          if (empty($ids)) {
              return array();
          }
  
          $sites = $this->getModel()->getPatternMatchSites($ids, $pattern, $limit);
  
          foreach ($sites as &$site) {
              $this->enrichSite($site);
          }
  
          $sites = Site::setSitesFromArray($sites);
  
          return $sites;
      }
code_tokens: public function getPatternMatchSites ( $ pattern , $ limit = false ) { $ ids = $ this -> getSitesIdWithAtLeastViewAccess ( ) ; if ( empty ( $ ids ) ) { return array ( ) ; } $ sites = $ this -> getModel ( ) -> getPatternMatchSites ( $ ids , $ pattern , $ limit ) ; foreach ( $ sites as & $ site ) { $ this -> enrichSite ( $ site ) ; } $ sites = Site :: setSitesFromArray ( $ sites ) ; return $ sites ; }
docstring: Find websites matching the given pattern.
  
  Any website will be returned that matches the pattern in the name, URL or group.
  To limit the number of returned sites you can either specify `filter_limit` as usual or `limit` which is
  faster.
  
  @param string $pattern
  @param int|false $limit
  @return array
docstring_tokens: Find websites matching the given pattern .