original_string: public static function setSitesFromArray($sites)
      {
          self::triggerSetSitesEvent($sites);
  
          foreach ($sites as $site) {
              $idSite = null;
              if (!empty($site['idsite'])) {
                  $idSite = $site['idsite'];
              }
  
              self::setSiteFromArray($idSite, $site);
          }
  
          return $sites;
      }
code: public static function setSitesFromArray($sites)
      {
          self::triggerSetSitesEvent($sites);
  
          foreach ($sites as $site) {
              $idSite = null;
              if (!empty($site['idsite'])) {
                  $idSite = $site['idsite'];
              }
  
              self::setSiteFromArray($idSite, $site);
          }
  
          return $sites;
      }
code_tokens: public static function setSitesFromArray ( $ sites ) { self :: triggerSetSitesEvent ( $ sites ) ; foreach ( $ sites as $ site ) { $ idSite = null ; if ( ! empty ( $ site [ 'idsite' ] ) ) { $ idSite = $ site [ 'idsite' ] ; } self :: setSiteFromArray ( $ idSite , $ site ) ; } return $ sites ; }
docstring: Sets the cached Site data with a non-associated array of site data.
  
  This method will trigger the `Sites.setSites` event modifying `$sites` before setting cached
  site data. In other words, this method will change the site data before it is cached and then
  return the modified array.
  
  @param array $sites The array of sites data. eg,
  
  array(
  array('idsite' => '1', 'name' => 'Site 1', ...),
  array('idsite' => '2', 'name' => 'Site 2', ...),
  )
  @return array The modified array.
  @deprecated
  @internal
docstring_tokens: Sets the cached Site data with a non - associated array of site data .