@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * Handles inclusion of ec_profiles. |
| 63 | 63 | */ |
| 64 | 64 | protected function ec_profile() { |
| 65 | - return function ($ec, $include, $included) { |
|
| 65 | + return function($ec, $include, $included) { |
|
| 66 | 66 | $serializer = new EcProfileSerializer($included); |
| 67 | 67 | |
| 68 | 68 | if (!$ec->ec_profile_id) { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * Handles inclusion of most_recent_ec_state_ratings. |
| 82 | 82 | */ |
| 83 | 83 | protected function most_recent_ec_state_rating() { |
| 84 | - return function ($ec, $include, $included) { |
|
| 84 | + return function($ec, $include, $included) { |
|
| 85 | 85 | $serializer = new EcStateRatingSerializer($included); |
| 86 | 86 | |
| 87 | 87 | if (!isset($ec->most_recent_ec_state_rating)) { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | self::$potentialDataTables = \Drupal\esdportal_api\EcDataUtils::getDataTablesWithProgramIds(); |
| 107 | 107 | self::$potentialDataTableNames = \Drupal\esdportal_api\EcDataUtils::extractDataTableNames(self::$potentialDataTables); |
| 108 | 108 | |
| 109 | - return function ($ec, $include, $included) use ($method) { |
|
| 109 | + return function($ec, $include, $included) use ($method) { |
|
| 110 | 110 | // The actual called method is underscore-separated... |
| 111 | 111 | $table_name = $method; |
| 112 | 112 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * Handles inclusion of school_profiles. |
| 85 | 85 | */ |
| 86 | 86 | protected function school_profile() { |
| 87 | - return function ($school, $include, $included) { |
|
| 87 | + return function($school, $include, $included) { |
|
| 88 | 88 | $serializer = new SchoolProfileSerializer($included); |
| 89 | 89 | |
| 90 | 90 | if (!$school->school_profile_id) { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | self::$potentialDataTables = \Drupal\esdportal_api\EcDataUtils::getDataTablesWithBcodes(); |
| 110 | 110 | self::$potentialDataTableNames = \Drupal\esdportal_api\EcDataUtils::extractDataTableNames(self::$potentialDataTables); |
| 111 | 111 | |
| 112 | - return function ($school, $include, $included) use ($method) { |
|
| 112 | + return function($school, $include, $included) use ($method) { |
|
| 113 | 113 | // The actual called method is underscore-separated... |
| 114 | 114 | $table_name = $method; |
| 115 | 115 | |
@@ -1338,7 +1338,7 @@ discard block |
||
| 1338 | 1338 | * = “Early Head Start” {tid:5158} OR “Head Start” {tid:5155} OR |
| 1339 | 1339 | * “Great Start Readiness Program {tid:5154} |
| 1340 | 1340 | */ |
| 1341 | -function esdportal_api_query_ec_profile_is_free_or_reduced_cost_alter(\QueryAlterableInterface &$query) { |
|
| 1341 | +function esdportal_api_query_ec_profile_is_free_or_reduced_cost_alter(\QueryAlterableInterface & $query) { |
|
| 1342 | 1342 | // First, inner join with ec_profiles. |
| 1343 | 1343 | if (!$query->hasTag('has_ec_profile')) { |
| 1344 | 1344 | esdportal_api_query_has_ec_profile_alter($query); |
@@ -1355,7 +1355,7 @@ discard block |
||
| 1355 | 1355 | * |
| 1356 | 1356 | * IF ec_profile.field_ec_transportation = 1 |
| 1357 | 1357 | */ |
| 1358 | -function esdportal_api_query_ec_profile_has_transportation_alter(\QueryAlterableInterface &$query) { |
|
| 1358 | +function esdportal_api_query_ec_profile_has_transportation_alter(\QueryAlterableInterface & $query) { |
|
| 1359 | 1359 | // First, inner join with ec_profiles. |
| 1360 | 1360 | if (!$query->hasTag('has_ec_profile')) { |
| 1361 | 1361 | esdportal_api_query_has_ec_profile_alter($query); |
@@ -1371,7 +1371,7 @@ discard block |
||
| 1371 | 1371 | * |
| 1372 | 1372 | * IF ec_profile.field_ec_special {vid:34} CONTAINS more than 5 values/items. |
| 1373 | 1373 | */ |
| 1374 | -function esdportal_api_query_ec_profile_has_special_needs_experience_alter(\QueryAlterableInterface &$query) { |
|
| 1374 | +function esdportal_api_query_ec_profile_has_special_needs_experience_alter(\QueryAlterableInterface & $query) { |
|
| 1375 | 1375 | // First, inner join with ec_profiles. |
| 1376 | 1376 | if (!$query->hasTag('has_ec_profile')) { |
| 1377 | 1377 | esdportal_api_query_has_ec_profile_alter($query); |
@@ -1389,7 +1389,7 @@ discard block |
||
| 1389 | 1389 | * IF ec_profile.field_ec_meals {vid:30} = “Lunch” {tid:5163} |
| 1390 | 1390 | * AND “Afternoon Snack” {tid:5164} |
| 1391 | 1391 | */ |
| 1392 | -function esdportal_api_query_ec_profile_has_meals_alter(\QueryAlterableInterface &$query) { |
|
| 1392 | +function esdportal_api_query_ec_profile_has_meals_alter(\QueryAlterableInterface & $query) { |
|
| 1393 | 1393 | // First, inner join with ec_profiles. |
| 1394 | 1394 | if (!$query->hasTag('has_ec_profile')) { |
| 1395 | 1395 | esdportal_api_query_has_ec_profile_alter($query); |
@@ -1410,7 +1410,7 @@ discard block |
||
| 1410 | 1410 | * |
| 1411 | 1411 | * Only return early childhood centers with a record in esd_el_2014. |
| 1412 | 1412 | */ |
| 1413 | -function esdportal_api_query_has_esd_el_2014_alter(\QueryAlterableInterface &$query) { |
|
| 1413 | +function esdportal_api_query_has_esd_el_2014_alter(\QueryAlterableInterface & $query) { |
|
| 1414 | 1414 | // Join with field_data_field_esd_ec_id to get program_id. |
| 1415 | 1415 | if (!$query->hasTag('has_esd_ec_id')) { |
| 1416 | 1416 | esdportal_api_query_has_esd_ec_id_alter($query); |
@@ -1425,7 +1425,7 @@ discard block |
||
| 1425 | 1425 | * |
| 1426 | 1426 | * Only return early childhood centers with a record in esd_el_2015. |
| 1427 | 1427 | */ |
| 1428 | -function esdportal_api_query_has_esd_el_2015_alter(\QueryAlterableInterface &$query) { |
|
| 1428 | +function esdportal_api_query_has_esd_el_2015_alter(\QueryAlterableInterface & $query) { |
|
| 1429 | 1429 | // Join with field_data_field_esd_ec_id to get program_id. |
| 1430 | 1430 | if (!$query->hasTag('has_esd_ec_id')) { |
| 1431 | 1431 | esdportal_api_query_has_esd_ec_id_alter($query); |
@@ -1440,7 +1440,7 @@ discard block |
||
| 1440 | 1440 | * |
| 1441 | 1441 | * Only return early childhood centers with an ec_id. |
| 1442 | 1442 | */ |
| 1443 | -function esdportal_api_query_has_esd_ec_id_alter(\QueryAlterableInterface &$query) { |
|
| 1443 | +function esdportal_api_query_has_esd_ec_id_alter(\QueryAlterableInterface & $query) { |
|
| 1444 | 1444 | $query->join('field_data_field_esd_ec_id', 'ec_id', 'ec_id.entity_id=taxonomy_term_data.tid'); |
| 1445 | 1445 | } |
| 1446 | 1446 | |
@@ -1449,7 +1449,7 @@ discard block |
||
| 1449 | 1449 | * |
| 1450 | 1450 | * Only return early childhood centers with a record in ec_state_ratings. |
| 1451 | 1451 | */ |
| 1452 | -function esdportal_api_query_has_ec_state_rating_alter(\QueryAlterableInterface &$query) { |
|
| 1452 | +function esdportal_api_query_has_ec_state_rating_alter(\QueryAlterableInterface & $query) { |
|
| 1453 | 1453 | // Join with field_data_field_esd_ec_id to get program_id. |
| 1454 | 1454 | if (!$query->hasTag('has_esd_ec_id')) { |
| 1455 | 1455 | esdportal_api_query_has_esd_ec_id_alter($query); |
@@ -1465,7 +1465,7 @@ discard block |
||
| 1465 | 1465 | * @param \QueryAlterableInterface &$query |
| 1466 | 1466 | * A query, probably looking for ec taxonomy terms. |
| 1467 | 1467 | */ |
| 1468 | -function esdportal_api_query_has_ec_profile_alter(\QueryAlterableInterface &$query) { |
|
| 1468 | +function esdportal_api_query_has_ec_profile_alter(\QueryAlterableInterface & $query) { |
|
| 1469 | 1469 | $query->join('field_data_field_ec', 'ec_profile_ref', 'ec_profile_ref.field_ec_tid=taxonomy_term_data.tid'); |
| 1470 | 1470 | $query->condition('ec_profile_ref.bundle', 'ec_profile', '='); |
| 1471 | 1471 | } |
@@ -1478,7 +1478,7 @@ discard block |
||
| 1478 | 1478 | * @param \QueryAlterableInterface &$query |
| 1479 | 1479 | * A query. |
| 1480 | 1480 | */ |
| 1481 | -function _esdportal_api_add_ec_ti_join(\QueryAlterableInterface &$query) { |
|
| 1481 | +function _esdportal_api_add_ec_ti_join(\QueryAlterableInterface & $query) { |
|
| 1482 | 1482 | $query->join('taxonomy_index', 'ti', 'ti.nid=ec_profile_ref.entity_id'); |
| 1483 | 1483 | $query->groupBy('ti.nid'); |
| 1484 | 1484 | } |
@@ -1491,7 +1491,7 @@ discard block |
||
| 1491 | 1491 | * @param \QueryAlterableInterface &$query |
| 1492 | 1492 | * A query. |
| 1493 | 1493 | */ |
| 1494 | -function esdportal_api_query_join_special_ed_level_alter(\QueryAlterableInterface &$query) { |
|
| 1494 | +function esdportal_api_query_join_special_ed_level_alter(\QueryAlterableInterface & $query) { |
|
| 1495 | 1495 | // First, inner join with school_profiles. |
| 1496 | 1496 | if (!$query->hasTag('has_school_profile')) { |
| 1497 | 1497 | esdportal_api_query_has_school_profile_alter($query); |
@@ -1509,7 +1509,7 @@ discard block |
||
| 1509 | 1509 | * @param \QueryAlterableInterface &$query |
| 1510 | 1510 | * A query. |
| 1511 | 1511 | */ |
| 1512 | -function esdportal_api_query_join_special_ed_programs_alter(\QueryAlterableInterface &$query) { |
|
| 1512 | +function esdportal_api_query_join_special_ed_programs_alter(\QueryAlterableInterface & $query) { |
|
| 1513 | 1513 | // First, inner join with school_profiles. |
| 1514 | 1514 | if (!$query->hasTag('has_school_profile')) { |
| 1515 | 1515 | esdportal_api_query_has_school_profile_alter($query); |
@@ -1524,7 +1524,7 @@ discard block |
||
| 1524 | 1524 | * |
| 1525 | 1525 | * IF school_profile.field_special_ed_level = moderate OR intensive. |
| 1526 | 1526 | */ |
| 1527 | -function esdportal_api_query_school_profile_has_specialed_alter(\QueryAlterableInterface &$query) { |
|
| 1527 | +function esdportal_api_query_school_profile_has_specialed_alter(\QueryAlterableInterface & $query) { |
|
| 1528 | 1528 | // First, inner join with field_data_field_special_ed. |
| 1529 | 1529 | if (!$query->hasTag('join_special_ed_level')) { |
| 1530 | 1530 | esdportal_api_query_join_special_ed_level_alter($query); |
@@ -1544,7 +1544,7 @@ discard block |
||
| 1544 | 1544 | * OR IF schools.field_academic_focus = all_arts OR visual_arts OR |
| 1545 | 1545 | * performing_arts OR music. |
| 1546 | 1546 | */ |
| 1547 | -function esdportal_api_query_school_profile_has_arts_alter(\QueryAlterableInterface &$query) { |
|
| 1547 | +function esdportal_api_query_school_profile_has_arts_alter(\QueryAlterableInterface & $query) { |
|
| 1548 | 1548 | // First, inner join with school_profiles. |
| 1549 | 1549 | if (!$query->hasTag('has_school_profile')) { |
| 1550 | 1550 | esdportal_api_query_has_school_profile_alter($query); |
@@ -1594,7 +1594,7 @@ discard block |
||
| 1594 | 1594 | * IF school_profile.field_boys_sports CONTAINS 4 or more values/items |
| 1595 | 1595 | * AND IF schools.field_girls_sports CONTAINS 4 or more values/items. |
| 1596 | 1596 | */ |
| 1597 | -function esdportal_api_query_school_profile_has_sports_alter(\QueryAlterableInterface &$query) { |
|
| 1597 | +function esdportal_api_query_school_profile_has_sports_alter(\QueryAlterableInterface & $query) { |
|
| 1598 | 1598 | // First, inner join with school_profiles. |
| 1599 | 1599 | if (!$query->hasTag('has_school_profile')) { |
| 1600 | 1600 | esdportal_api_query_has_school_profile_alter($query); |
@@ -1626,7 +1626,7 @@ discard block |
||
| 1626 | 1626 | * IF school_profile.field_transportation_options = passes OR busses OR |
| 1627 | 1627 | * shared_bus. |
| 1628 | 1628 | */ |
| 1629 | -function esdportal_api_query_school_profile_has_transportation_alter(\QueryAlterableInterface &$query) { |
|
| 1629 | +function esdportal_api_query_school_profile_has_transportation_alter(\QueryAlterableInterface & $query) { |
|
| 1630 | 1630 | // First, inner join with school_profiles. |
| 1631 | 1631 | if (!$query->hasTag('has_school_profile')) { |
| 1632 | 1632 | esdportal_api_query_has_school_profile_alter($query); |
@@ -1641,7 +1641,7 @@ discard block |
||
| 1641 | 1641 | * |
| 1642 | 1642 | * IF school_profile.field_before_after_care = after OR before. |
| 1643 | 1643 | */ |
| 1644 | -function esdportal_api_query_school_profile_has_before_after_care_alter(\QueryAlterableInterface &$query) { |
|
| 1644 | +function esdportal_api_query_school_profile_has_before_after_care_alter(\QueryAlterableInterface & $query) { |
|
| 1645 | 1645 | // First, inner join with school_profiles. |
| 1646 | 1646 | if (!$query->hasTag('has_school_profile')) { |
| 1647 | 1647 | esdportal_api_query_has_school_profile_alter($query); |
@@ -1656,7 +1656,7 @@ discard block |
||
| 1656 | 1656 | * |
| 1657 | 1657 | * IF school_profile.field_application_process = yes. |
| 1658 | 1658 | */ |
| 1659 | -function esdportal_api_query_school_profile_application_required_alter(\QueryAlterableInterface &$query) { |
|
| 1659 | +function esdportal_api_query_school_profile_application_required_alter(\QueryAlterableInterface & $query) { |
|
| 1660 | 1660 | // First, inner join with school_profiles. |
| 1661 | 1661 | if (!$query->hasTag('has_school_profile')) { |
| 1662 | 1662 | esdportal_api_query_has_school_profile_alter($query); |
@@ -1674,7 +1674,7 @@ discard block |
||
| 1674 | 1674 | * OR IF school_profile.field_staff_resources = college_counselor |
| 1675 | 1675 | * AND IF school_profile.field_college_prep CONTAINS any value EXCEPT none. |
| 1676 | 1676 | */ |
| 1677 | -function esdportal_api_query_school_profile_collegereadiness_alter(\QueryAlterableInterface &$query) { |
|
| 1677 | +function esdportal_api_query_school_profile_collegereadiness_alter(\QueryAlterableInterface & $query) { |
|
| 1678 | 1678 | // First, inner join with school_profiles. |
| 1679 | 1679 | if (!$query->hasTag('has_school_profile')) { |
| 1680 | 1680 | esdportal_api_query_has_school_profile_alter($query); |
@@ -1693,7 +1693,7 @@ discard block |
||
| 1693 | 1693 | * @param \QueryAlterableInterface &$query |
| 1694 | 1694 | * A query, probably looking for school taxonomy terms. |
| 1695 | 1695 | */ |
| 1696 | -function esdportal_api_query_has_school_profile_alter(\QueryAlterableInterface &$query) { |
|
| 1696 | +function esdportal_api_query_has_school_profile_alter(\QueryAlterableInterface & $query) { |
|
| 1697 | 1697 | $query->join('field_data_field_school', 'school_profile_ref', 'school_profile_ref.field_school_tid=taxonomy_term_data.tid'); |
| 1698 | 1698 | $query->condition('school_profile_ref.bundle', 'school_profile', '='); |
| 1699 | 1699 | $query->addField('school_profile_ref', 'entity_id', 'school_profile_id'); |
@@ -1705,7 +1705,7 @@ discard block |
||
| 1705 | 1705 | * @param \QueryAlterableInterface &$query |
| 1706 | 1706 | * A query, probably looking for school taxonomy terms. |
| 1707 | 1707 | */ |
| 1708 | -function esdportal_api_query_ec_profile_changed_asc_alter(\QueryAlterableInterface &$query) { |
|
| 1708 | +function esdportal_api_query_ec_profile_changed_asc_alter(\QueryAlterableInterface & $query) { |
|
| 1709 | 1709 | if (!$query->hasTag('has_ec_profile')) { |
| 1710 | 1710 | esdportal_api_query_has_ec_profile_alter($query); |
| 1711 | 1711 | $query->addTag('has_ec_profile'); |
@@ -1714,7 +1714,7 @@ discard block |
||
| 1714 | 1714 | $query->join('node', 'n', 'ec_profile_ref.entity_id=n.nid'); |
| 1715 | 1715 | |
| 1716 | 1716 | // Our orderBy comes first! |
| 1717 | - $order =& $query->getOrderBy(); |
|
| 1717 | + $order = & $query->getOrderBy(); |
|
| 1718 | 1718 | $order = array_reverse($order, TRUE); |
| 1719 | 1719 | $order['n.changed'] = 'ASC'; |
| 1720 | 1720 | $order = array_reverse($order, TRUE); |
@@ -1726,7 +1726,7 @@ discard block |
||
| 1726 | 1726 | * @param \QueryAlterableInterface &$query |
| 1727 | 1727 | * A query, probably looking for school taxonomy terms. |
| 1728 | 1728 | */ |
| 1729 | -function esdportal_api_query_ec_profile_changed_desc_alter(\QueryAlterableInterface &$query) { |
|
| 1729 | +function esdportal_api_query_ec_profile_changed_desc_alter(\QueryAlterableInterface & $query) { |
|
| 1730 | 1730 | if (!$query->hasTag('has_ec_profile')) { |
| 1731 | 1731 | esdportal_api_query_has_ec_profile_alter($query); |
| 1732 | 1732 | $query->addTag('has_ec_profile'); |
@@ -1735,7 +1735,7 @@ discard block |
||
| 1735 | 1735 | $query->join('node', 'n', 'ec_profile_ref.entity_id=n.nid'); |
| 1736 | 1736 | |
| 1737 | 1737 | // Our orderBy comes first! |
| 1738 | - $order =& $query->getOrderBy(); |
|
| 1738 | + $order = & $query->getOrderBy(); |
|
| 1739 | 1739 | $order = array_reverse($order, TRUE); |
| 1740 | 1740 | $order['n.changed'] = 'DESC'; |
| 1741 | 1741 | $order = array_reverse($order, TRUE); |
@@ -1747,7 +1747,7 @@ discard block |
||
| 1747 | 1747 | * @param \QueryAlterableInterface &$query |
| 1748 | 1748 | * A query, probably looking for school taxonomy terms. |
| 1749 | 1749 | */ |
| 1750 | -function esdportal_api_query_school_profile_changed_asc_alter(\QueryAlterableInterface &$query) { |
|
| 1750 | +function esdportal_api_query_school_profile_changed_asc_alter(\QueryAlterableInterface & $query) { |
|
| 1751 | 1751 | if (!$query->hasTag('has_school_profile')) { |
| 1752 | 1752 | esdportal_api_query_has_school_profile_alter($query); |
| 1753 | 1753 | $query->addTag('has_school_profile'); |
@@ -1756,7 +1756,7 @@ discard block |
||
| 1756 | 1756 | $query->join('node', 'n', 'school_profile_ref.entity_id=n.nid'); |
| 1757 | 1757 | |
| 1758 | 1758 | // Our orderBy comes first! |
| 1759 | - $order =& $query->getOrderBy(); |
|
| 1759 | + $order = & $query->getOrderBy(); |
|
| 1760 | 1760 | $order = array_reverse($order, TRUE); |
| 1761 | 1761 | $order['n.changed'] = 'ASC'; |
| 1762 | 1762 | $order = array_reverse($order, TRUE); |
@@ -1768,7 +1768,7 @@ discard block |
||
| 1768 | 1768 | * @param \QueryAlterableInterface &$query |
| 1769 | 1769 | * A query, probably looking for school taxonomy terms. |
| 1770 | 1770 | */ |
| 1771 | -function esdportal_api_query_school_profile_changed_desc_alter(\QueryAlterableInterface &$query) { |
|
| 1771 | +function esdportal_api_query_school_profile_changed_desc_alter(\QueryAlterableInterface & $query) { |
|
| 1772 | 1772 | if (!$query->hasTag('has_school_profile')) { |
| 1773 | 1773 | esdportal_api_query_has_school_profile_alter($query); |
| 1774 | 1774 | $query->addTag('has_school_profile'); |
@@ -1777,7 +1777,7 @@ discard block |
||
| 1777 | 1777 | $query->join('node', 'n', 'school_profile_ref.entity_id=n.nid'); |
| 1778 | 1778 | |
| 1779 | 1779 | // Our orderBy comes first! |
| 1780 | - $order =& $query->getOrderBy(); |
|
| 1780 | + $order = & $query->getOrderBy(); |
|
| 1781 | 1781 | $order = array_reverse($order, TRUE); |
| 1782 | 1782 | $order['n.changed'] = 'DESC'; |
| 1783 | 1783 | $order = array_reverse($order, TRUE); |
@@ -1789,7 +1789,7 @@ discard block |
||
| 1789 | 1789 | * @param \QueryAlterableInterface &$query |
| 1790 | 1790 | * A query, probably looking for school taxonomy terms. |
| 1791 | 1791 | */ |
| 1792 | -function esdportal_api_query_ec_total_pts_desc_alter(\QueryAlterableInterface &$query) { |
|
| 1792 | +function esdportal_api_query_ec_total_pts_desc_alter(\QueryAlterableInterface & $query) { |
|
| 1793 | 1793 | // Add tag (which also adds needed joins) |
| 1794 | 1794 | if (!$query->hasTag('has_ec_state_rating')) { |
| 1795 | 1795 | esdportal_api_query_has_ec_state_rating_alter($query); |
@@ -1797,7 +1797,7 @@ discard block |
||
| 1797 | 1797 | } |
| 1798 | 1798 | |
| 1799 | 1799 | // Our orderBy comes first. |
| 1800 | - $order =& $query->getOrderBy(); |
|
| 1800 | + $order = & $query->getOrderBy(); |
|
| 1801 | 1801 | $order = array_reverse($order, TRUE); |
| 1802 | 1802 | $order['esr.total_points'] = 'DESC'; |
| 1803 | 1803 | $order = array_reverse($order, TRUE); |
@@ -1809,7 +1809,7 @@ discard block |
||
| 1809 | 1809 | * @param \QueryAlterableInterface &$query |
| 1810 | 1810 | * A query, probably looking for school taxonomy terms. |
| 1811 | 1811 | */ |
| 1812 | -function esdportal_api_query_ec_total_pts_asc_alter(\QueryAlterableInterface &$query) { |
|
| 1812 | +function esdportal_api_query_ec_total_pts_asc_alter(\QueryAlterableInterface & $query) { |
|
| 1813 | 1813 | // Add tag (which also adds needed joins) |
| 1814 | 1814 | if (!$query->hasTag('has_ec_state_rating')) { |
| 1815 | 1815 | esdportal_api_query_has_ec_state_rating_alter($query); |
@@ -1817,7 +1817,7 @@ discard block |
||
| 1817 | 1817 | } |
| 1818 | 1818 | |
| 1819 | 1819 | // Our orderBy comes first. |
| 1820 | - $order =& $query->getOrderBy(); |
|
| 1820 | + $order = & $query->getOrderBy(); |
|
| 1821 | 1821 | $order = array_reverse($order, TRUE); |
| 1822 | 1822 | $order['esr.total_points'] = 'ASC'; |
| 1823 | 1823 | $order = array_reverse($order, TRUE); |
@@ -1829,7 +1829,7 @@ discard block |
||
| 1829 | 1829 | * @param \QueryAlterableInterface &$query |
| 1830 | 1830 | * A query, probably looking for school taxonomy terms. |
| 1831 | 1831 | */ |
| 1832 | -function esdportal_api_query_has_bcode_alter(\QueryAlterableInterface &$query) { |
|
| 1832 | +function esdportal_api_query_has_bcode_alter(\QueryAlterableInterface & $query) { |
|
| 1833 | 1833 | $query->join('field_data_field_bcode', 'field_bcode', "field_bcode.entity_id=taxonomy_term_data.tid AND field_bcode.bundle='schools'"); |
| 1834 | 1834 | } |
| 1835 | 1835 | |
@@ -1839,7 +1839,7 @@ discard block |
||
| 1839 | 1839 | * @param \QueryAlterableInterface &$query |
| 1840 | 1840 | * A query, probably looking for school taxonomy terms. |
| 1841 | 1841 | */ |
| 1842 | -function esdportal_api_query_esd_k8hs_2015_highscore_alter(\QueryAlterableInterface &$query) { |
|
| 1842 | +function esdportal_api_query_esd_k8hs_2015_highscore_alter(\QueryAlterableInterface & $query) { |
|
| 1843 | 1843 | // Add bcode join. |
| 1844 | 1844 | if (!$query->hasTag('has_bcode')) { |
| 1845 | 1845 | esdportal_api_query_has_bcode_alter($query); |
@@ -1868,7 +1868,7 @@ discard block |
||
| 1868 | 1868 | * @param \QueryAlterableInterface &$query |
| 1869 | 1869 | * A query, probably looking for early childhood taxonomy terms. |
| 1870 | 1870 | */ |
| 1871 | -function esdportal_api_query_esd_el_highscore_alter(\QueryAlterableInterface &$query) { |
|
| 1871 | +function esdportal_api_query_esd_el_highscore_alter(\QueryAlterableInterface & $query) { |
|
| 1872 | 1872 | // Join with ec_state_ratings. |
| 1873 | 1873 | if (!$query->hasTag('has_ec_state_rating')) { |
| 1874 | 1874 | esdportal_api_query_has_ec_state_rating_alter($query); |
@@ -1884,7 +1884,7 @@ discard block |
||
| 1884 | 1884 | * @param \QueryAlterableInterface &$query |
| 1885 | 1885 | * A query, probably looking for school taxonomy terms. |
| 1886 | 1886 | */ |
| 1887 | -function esdportal_api_query_school_combined_total_pts_desc_alter(\QueryAlterableInterface &$query) { |
|
| 1887 | +function esdportal_api_query_school_combined_total_pts_desc_alter(\QueryAlterableInterface & $query) { |
|
| 1888 | 1888 | // Add bcode join. |
| 1889 | 1889 | if (!$query->hasTag('has_bcode')) { |
| 1890 | 1890 | esdportal_api_query_has_bcode_alter($query); |
@@ -1906,7 +1906,7 @@ discard block |
||
| 1906 | 1906 | $query->join($k8_scores, 'scores', 'score_bcode=field_bcode.field_bcode_value'); |
| 1907 | 1907 | |
| 1908 | 1908 | // Our orderBy comes first. |
| 1909 | - $order =& $query->getOrderBy(); |
|
| 1909 | + $order = & $query->getOrderBy(); |
|
| 1910 | 1910 | $order = array_reverse($order, TRUE); |
| 1911 | 1911 | $order['scores.score'] = 'DESC'; |
| 1912 | 1912 | $order = array_reverse($order, TRUE); |
@@ -1918,7 +1918,7 @@ discard block |
||
| 1918 | 1918 | * @param \QueryAlterableInterface &$query |
| 1919 | 1919 | * A query, probably looking for school taxonomy terms. |
| 1920 | 1920 | */ |
| 1921 | -function esdportal_api_query_school_combined_total_pts_asc_alter(\QueryAlterableInterface &$query) { |
|
| 1921 | +function esdportal_api_query_school_combined_total_pts_asc_alter(\QueryAlterableInterface & $query) { |
|
| 1922 | 1922 | // Add bcode join. |
| 1923 | 1923 | if (!$query->hasTag('has_bcode')) { |
| 1924 | 1924 | esdportal_api_query_has_bcode_alter($query); |
@@ -1940,7 +1940,7 @@ discard block |
||
| 1940 | 1940 | $query->join($k8_scores, 'scores', 'score_bcode=field_bcode.field_bcode_value'); |
| 1941 | 1941 | |
| 1942 | 1942 | // Our orderBy comes first. |
| 1943 | - $order =& $query->getOrderBy(); |
|
| 1943 | + $order = & $query->getOrderBy(); |
|
| 1944 | 1944 | $order = array_reverse($order, TRUE); |
| 1945 | 1945 | $order['scores.score'] = 'ASC'; |
| 1946 | 1946 | $order = array_reverse($order, TRUE); |
@@ -1952,7 +1952,7 @@ discard block |
||
| 1952 | 1952 | * @param \QueryAlterableInterface &$query |
| 1953 | 1953 | * A query, probably looking for school or EC taxonomy terms. |
| 1954 | 1954 | */ |
| 1955 | -function esdportal_api_query_has_geo_alter(\QueryAlterableInterface &$query) { |
|
| 1955 | +function esdportal_api_query_has_geo_alter(\QueryAlterableInterface & $query) { |
|
| 1956 | 1956 | $query->join('field_data_field_geo', 'field_geo', 'field_geo.entity_id=taxonomy_term_data.tid'); |
| 1957 | 1957 | } |
| 1958 | 1958 | |
@@ -1967,7 +1967,7 @@ discard block |
||
| 1967 | 1967 | * @param \QueryAlterableInterface &$query |
| 1968 | 1968 | * A query, probably looking for school or EC taxonomy terms. |
| 1969 | 1969 | */ |
| 1970 | -function esdportal_api_query_geoproximity_alter(\QueryAlterableInterface &$query) { |
|
| 1970 | +function esdportal_api_query_geoproximity_alter(\QueryAlterableInterface & $query) { |
|
| 1971 | 1971 | // Add geo join. |
| 1972 | 1972 | if (!$query->hasTag('has_geo')) { |
| 1973 | 1973 | esdportal_api_query_has_geo_alter($query); |
@@ -2016,7 +2016,7 @@ discard block |
||
| 2016 | 2016 | /** |
| 2017 | 2017 | * Adds a field_special_ed_level filter. |
| 2018 | 2018 | */ |
| 2019 | -function esdportal_api_query_field_special_ed_level_filter_alter(\QueryAlterableInterface &$query) { |
|
| 2019 | +function esdportal_api_query_field_special_ed_level_filter_alter(\QueryAlterableInterface & $query) { |
|
| 2020 | 2020 | // Get parameters from query metadata. |
| 2021 | 2021 | $levels = $query->getMetaData('field_special_ed_level_filter'); |
| 2022 | 2022 | |
@@ -2036,7 +2036,7 @@ discard block |
||
| 2036 | 2036 | /** |
| 2037 | 2037 | * Adds a field_special_ed_programs filter. |
| 2038 | 2038 | */ |
| 2039 | -function esdportal_api_query_field_special_ed_programs_filter_alter(\QueryAlterableInterface &$query) { |
|
| 2039 | +function esdportal_api_query_field_special_ed_programs_filter_alter(\QueryAlterableInterface & $query) { |
|
| 2040 | 2040 | // Get parameters from query metadata. |
| 2041 | 2041 | $programs = $query->getMetaData('field_special_ed_programs_filter'); |
| 2042 | 2042 | |