1 | <?php |
||
25 | class Registration extends Invitation |
||
26 | { |
||
27 | const INVITATION_REGISTRATION = 0x01; |
||
28 | public $allowRepeated = false; |
||
29 | |||
30 | /** |
||
31 | * @inheritdoc |
||
32 | */ |
||
33 | 8 | public function init() |
|
34 | { |
||
35 | 8 | parent::init(); |
|
36 | 8 | if ($this->getIsNewRecord()) { |
|
37 | 8 | $this->content = self::INVITATION_REGISTRATION; |
|
38 | 8 | } elseif ($this->content != self::INVITATION_REGISTRATION) { |
|
39 | throw new InvalidConfigException("This invitation is not being used for registration."); |
||
40 | } |
||
41 | 8 | } |
|
42 | |||
43 | /** |
||
44 | * Returns the search instance and limits the search range to the registration. |
||
45 | * @return BaseBlameableQuery |
||
46 | */ |
||
47 | 7 | public static function find() |
|
51 | |||
52 | /** |
||
53 | * Returns the search instance and attach the specific invitee. |
||
54 | * @param User|string|array $invitee |
||
55 | * @return BaseBlameableQuery |
||
56 | */ |
||
57 | 1 | public static function findByInvitee($invitee) |
|
61 | } |
||
62 |