feat: ignored room types
closes #869bvbmcw
This commit is contained in:
@@ -24,6 +24,13 @@ class TravelParser extends AbstractParser
|
||||
{
|
||||
private AgeConstraintParserRegistry $ageConstraintRegistry;
|
||||
|
||||
/**
|
||||
* @var array<string>
|
||||
*/
|
||||
private array $ignoredRoomCodes = [
|
||||
Constants::PSEUDO_PRICE_ROOM_CODE,
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ageConstraintRegistry = new AgeConstraintParserRegistry();
|
||||
@@ -319,11 +326,17 @@ class TravelParser extends AbstractParser
|
||||
$rooms = [];
|
||||
|
||||
$roomNodes->each(function (Crawler $roomNode) use (&$rooms) {
|
||||
$roomCode = $roomNode->attr('zimmercode');
|
||||
|
||||
if (true === in_array($roomCode, $this->ignoredRoomCodes, true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$roomId = (int) $roomNode->attr('idbuspro_zimmer');
|
||||
|
||||
$room = new Room();
|
||||
$room->id = $roomId;
|
||||
$room->code = $roomNode->attr('zimmercode');
|
||||
$room->code = $roomCode;
|
||||
$room->category = $roomNode->attr('kat');
|
||||
$room->boardId = (int) $roomNode->attr('idbuspro_vp');
|
||||
$room->label = $roomNode->attr('zimmertext');
|
||||
|
||||
Reference in New Issue
Block a user