private function process(array $data) {
    // Group items at first.
    $grouped = [];
    foreach ($data as $locationId => $locationItems) {
      foreach ($locationItems as $item) {
        $grouped[$locationId][$item['class_id']][] = $item;
      }
    }

    $hashes = [];
    $processed = [];

    foreach ($grouped as $locationId => $locationData) {
      foreach ($locationData as $classId => $classData) {
        $hashes[$locationId][$classId] = (string) md5(serialize($classData));

        foreach ($classData as $class) {
          $this->cleanUpTitle($class);
          $class['location_id'] = $locationId;
          $processed[$locationId][$classId][] = $class;
        }
      }
    }

    $this->hashes = $hashes;

    return $processed;
  }
private function process(array $data) {
    // Group items at first.
    $grouped = [];
    foreach ($data as $locationId => $locationItems) {
      foreach ($locationItems as $item) {
        $grouped[$locationId][$item['class_id']][] = $item;
      }
    }

    $hashes = [];
    $processed = [];

    foreach ($grouped as $locationId => $locationData) {
      foreach ($locationData as $classId => $classData) {
        $hashes[$locationId][$classId] = (string) md5(serialize($classData));

        foreach ($classData as $class) {
          $this->cleanUpTitle($class);
          $class['location_id'] = $locationId;
          $processed[$locationId][$classId][] = $class;
        }
      }
    }

    $this->hashes = $hashes;

    return $processed;
  }
private function process ( array $ data ) { // Group items at first. $ grouped = [ ] ; foreach ( $ data as $ locationId => $ locationItems ) { foreach ( $ locationItems as $ item ) { $ grouped [ $ locationId ] [ $ item [ 'class_id' ] ] [ ] = $ item ; } } $ hashes = [ ] ; $ processed = [ ] ; foreach ( $ grouped as $ locationId => $ locationData ) { foreach ( $ locationData as $ classId => $ classData ) { $ hashes [ $ locationId ] [ $ classId ] = ( string ) md5 ( serialize ( $ classData ) ) ; foreach ( $ classData as $ class ) { $ this -> cleanUpTitle ( $ class ) ; $ class [ 'location_id' ] = $ locationId ; $ processed [ $ locationId ] [ $ classId ] [ ] = $ class ; } } } $ this -> hashes = $ hashes ; return $ processed ; }
Process data & create hashes.

@param array $data
Source data.

@return array
Processed data.
Process data & create hashes .