Skip to content

Commit

Permalink
add offsite facility filter
Browse files Browse the repository at this point in the history
  • Loading branch information
dseidl committed Dec 19, 2018
1 parent 82d604a commit a8fcae6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Model/Hotel.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ public function facilities()
->toArray();
}

public function offsiteFacilities()
{
return collect($this->get_field('hotel_data')->hotel_facilities)
->filter(function($facility) {
$attributes = collect($facility->attrs);

return $attributes->isNotEmpty() && $attributes->contains('offsite');
})
->mapInto(Hotel_Facility_Type::class)
->toArray();
}

public function hotel_changed_id()
{
return collect($this->get_field('changed_hotels'))
Expand Down

0 comments on commit a8fcae6

Please sign in to comment.