public function getSchoolsByLocation($id) {
    $schools = [];

    $cid = __METHOD__ . $id;
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $programs = $this->getChildCareProgramsByLocation($id);
    foreach ($programs as $program) {
      $schools_data = $this->getSchoolsByChildCareProgramId($program);
      foreach ($schools_data as $school) {
        $schools[$school['id']] = $school['name'];
      }
    }

    $this->cache->set($cid, $schools);
    return $schools;
  }
public function getSchoolsByLocation($id) {
    $schools = [];

    $cid = __METHOD__ . $id;
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $programs = $this->getChildCareProgramsByLocation($id);
    foreach ($programs as $program) {
      $schools_data = $this->getSchoolsByChildCareProgramId($program);
      foreach ($schools_data as $school) {
        $schools[$school['id']] = $school['name'];
      }
    }

    $this->cache->set($cid, $schools);
    return $schools;
  }
public function getSchoolsByLocation ( $ id ) { $ schools = [ ] ; $ cid = __METHOD__ . $ id ; if ( $ cache = $ this -> cache -> get ( $ cid ) ) { return $ cache -> data ; } $ programs = $ this -> getChildCareProgramsByLocation ( $ id ) ; foreach ( $ programs as $ program ) { $ schools_data = $ this -> getSchoolsByChildCareProgramId ( $ program ) ; foreach ( $ schools_data as $ school ) { $ schools [ $ school [ 'id' ] ] = $ school [ 'name' ] ; } } $ this -> cache -> set ( $ cid , $ schools ) ; return $ schools ; }
Get schools by location.

@param int $id
Location ID.

@return array
A list of schools.
Get schools by location .