allow marking of airport as hub and restrict to hubs at registration #86

This commit is contained in:
Nabeel Shahzad
2017-12-31 09:42:31 -06:00
parent 10a58b3350
commit 528a7c7440
9 changed files with 29 additions and 9 deletions

View File

@@ -25,10 +25,16 @@ class AirportRepository extends BaseRepository implements CacheableInterface
* Return the list of airports formatted for a select box
* @return array
*/
public function selectBoxList($add_blank=false): array
public function selectBoxList($add_blank=false, $only_hubs=false): array
{
$retval = [];
$items = $this->orderBy('icao', 'asc')->all();
$where = [];
if($only_hubs) {
$where['hub'] = 1;
}
$items = $this->orderBy('icao', 'asc')->findWhere($where);
if ($add_blank) {
$retval[''] = '';