Hello,
Is it ok to pass $this as a argument to a function
(bad) example:
class Order{
public function __construct($orderid, $user){
$this->OrderId = $orderid;
$this->User = $user;
}
public OrderId;
public Product;
public User;
}
class User{
public ID;
public function GetOrders(){
/*Some funky code to get Orders from database by userID.*/
$orders[] = new Order($row['orderId'], $this);
}
}
I know this works, im just making sure i am doing it correct
^^
Thanks