public function getChildCareProgramsBySchool($id) {
    $map = [];

    $cid = __METHOD__;
    if ($cache = $this->cache->get($cid)) {
      $map = $cache->data;
    }
    else {
      $programs_all = $this->getAllChildCarePrograms();
      foreach ($programs_all as $program) {
        $school_data = $this->getSchoolsByChildCareProgramId($program->id);
        foreach ($school_data as $school) {
          $map[$school['id']][$program->id] = $program->name;
        }
      }

      $this->cache->set($cid, $map);
    }

    return $map[$id];
  }
public function getChildCareProgramsBySchool($id) {
    $map = [];

    $cid = __METHOD__;
    if ($cache = $this->cache->get($cid)) {
      $map = $cache->data;
    }
    else {
      $programs_all = $this->getAllChildCarePrograms();
      foreach ($programs_all as $program) {
        $school_data = $this->getSchoolsByChildCareProgramId($program->id);
        foreach ($school_data as $school) {
          $map[$school['id']][$program->id] = $program->name;
        }
      }

      $this->cache->set($cid, $map);
    }

    return $map[$id];
  }
public function getChildCareProgramsBySchool ( $ id ) { $ map = [ ] ; $ cid = __METHOD__ ; if ( $ cache = $ this -> cache -> get ( $ cid ) ) { $ map = $ cache -> data ; } else { $ programs_all = $ this -> getAllChildCarePrograms ( ) ; foreach ( $ programs_all as $ program ) { $ school_data = $ this -> getSchoolsByChildCareProgramId ( $ program -> id ) ; foreach ( $ school_data as $ school ) { $ map [ $ school [ 'id' ] ] [ $ program -> id ] = $ program -> name ; } } $ this -> cache -> set ( $ cid , $ map ) ; } return $ map [ $ id ] ; }
Get programs by school.

@param int $id
School ID.

@return array
A list of programs.
Get programs by school .