Hello. I am trying to access a class object from within another class. Here is an example:
class RoomReservation {
/* int */
public $RoomConfigurationID = '111';
/* int */
public $NumberOfRooms = '0';
}
class CreateBooking {
/* dateTime */
public $Checkin = '2006-06-12';
/* dateTime */
public $Checkout = '2006-06-13';
/* ArrayOfRoomReservation */
public $Rooms = RoomReservation;
}
Right now this returns and empty instance of RoomReservation for Rooms, but
$Rooms = new RoomReservation; Causes a fatal error.
CreateBooking Object
(
[Checkin] => 2006-06-12
[Checkout] => 2006-06-13
[Rooms] => RoomReservation
)
If I output the contents of $Rooms = new RoomReservation; outside of the class it gives the correct result:
RoomReservation Object
(
[RoomConfigurationID] => 111
[NumberOfRooms] => 0
)
My Goal is this:
CreateBooking Object
(
[Checkin] => 2006-06-12
[Checkout] => 2006-06-13
[Rooms] => RoomReservation Object
(
[RoomConfigurationID] => 111
[NumberOfRooms] => 0
)
)
Thank you for any input you can give me on this.