add registrations to customer gui
This commit is contained in:
@@ -8,6 +8,8 @@ use common\models\Customer;
|
||||
use common\models\Event;
|
||||
use common\models\EventRegistration;
|
||||
use common\models\Ticket;
|
||||
use customerapi\models\available\EventInterval;
|
||||
use customerapi\models\registrations\EventRegistrationAvailable;
|
||||
use Exception;
|
||||
use Throwable;
|
||||
use Yii;
|
||||
@@ -252,5 +254,4 @@ class EventRegistrationManager extends BaseObject
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -68,11 +68,19 @@ class EventRegistration extends \yii\db\ActiveRecord
|
||||
|
||||
|
||||
public function getEvent(){
|
||||
return $this->hasOne(Event::class,['id' => 'id_event']);
|
||||
return $this->hasOne($this->getEventClass(),['id' => 'id_event']);
|
||||
}
|
||||
|
||||
public function getCustomer(){
|
||||
return $this->hasOne(Customer::class,['id' => 'id_customer']);
|
||||
return $this->hasOne($this->getCustomerClass(),['id' => 'id_customer']);
|
||||
}
|
||||
|
||||
|
||||
public function getEventClass(){
|
||||
return Event::class;
|
||||
}
|
||||
|
||||
public function getCustomerClass(){
|
||||
return Customer::class;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +151,10 @@ class EventManager
|
||||
return $this->getEvents($start,$to);
|
||||
}
|
||||
|
||||
public function getEvent($id){
|
||||
return Event::findOne($id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user