Add the event listener for the awards #155

This commit is contained in:
Nabeel Shahzad
2018-03-17 00:55:39 -05:00
parent 31b9195a6e
commit 26f00ccaae
9 changed files with 127 additions and 53 deletions

View File

@@ -29,15 +29,18 @@ class Award extends BaseModel
/**
* Get the referring object
* @param Award|null $award
* @param User|null $user
* @return null
*/
public function getReference()
public function getReference(Award $award=null, User $user=null)
{
if (!$this->ref_class) {
return null;
}
try {
return new $this->ref_class;
return new $this->ref_class($award, $user);
# return $klass;
# return $klass->find($this->ref_class_id);
} catch (\Exception $e) {