I have Entity:
class Booking extends Phalcon\Mvc\Model{
public $Id;
public $Route;
public function initialize(){
$this->belongsTo("Route","Route","Id");
}
}
class Route extends Phalcon\Mvc\Model{
public $DefaultData;
public function initialize(){
$this->belongsTo("DefaultData", "RouteDefaultData", "Id");
}
}
class RouteDefaultData extends Phalcon\Mvc\Model{
public $Id;
public $RouteName;
}
When i try to do something like
//working
echo $booking->Route // this return integer
//not working
echo $booking->Route->DefaultData->RouteName;
To meniton one thing. I am using:
$Bookings = Booking::find(
array(
"columns"=> "Id, SlotTime, FlightDate, BookingStatus, Route",
"conditions" => "FlightDate LIKE ?1",
"bind" => array(1 => date('Y').'-'.$selectedMonth."%")
)
);
Phalcon ORM Model returns object right? Not array.