public function load_associations() { if ($this->associations_loaded) { return; } $this->associations_loaded = TRUE; $this->events_in_carts = CRM_Event_Cart_BAO_EventInCart::find_all_by_event_cart_id($this->id); foreach ($this->events_in_carts as $event_in_cart) { $event_in_cart->load_associations($this); } $this->save(); }