You are here

public function MigrateSourceReservation::getNextRow in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

Implementation of MigrateSource::getNextRow().

Return value

object

Overrides MigrateSourceSQL::getNextRow

File

merci_migrate/merci_reservation.inc, line 82

Class

MigrateSourceReservation

Code

public function getNextRow() {
  $row = parent::getNextRow();
  if ($row) {
    $node = node_load($row->nid);
    if (is_object($node)) {
      $node->merci_reservations = merci_reservation_items($node);
      $node->reservation_items = array();
      foreach ($node->merci_reservations as $reservation) {
        $node->reservation_items[] = array(
          $reservation['merci_item_nid'],
          $row->nid,
        );
      }
      return $node;
    }
    else {
      return NULL;
    }
  }
  else {
    return NULL;
  }
}