You are here

public function FeatureContext::bookingsOfTypeForAllUnits in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

@Given /^(\d+) bookings of type "([^"]*)" for all "([^"]*)" units$/

File

test/features/bootstrap/FeatureContext.php, line 426

Class

FeatureContext
Features context.

Code

public function bookingsOfTypeForAllUnits($count, $type, $unit_type) {
  $efq = new EntityFieldQuery();
  $efq
    ->entityCondition('entity_type', 'rooms_unit')
    ->propertyCondition('type', $unit_type);
  $results = $efq
    ->execute();
  if ($results && isset($results['rooms_unit'])) {
    foreach ($results['rooms_unit'] as $unit_id => $unit) {
      $this
        ->createBookingsForUnit($count, $type, $unit_id);
    }
  }
}