Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2.3149 |
Changes | 0 |
1 | <?php |
||
150 | 1 | public static function getActiveForThisApp() : Subscription |
|
151 | { |
||
152 | 1 | $subscription = self::findFirst([ |
|
153 | 1 | 'conditions' => 'companies_id = ?0 and apps_id = ?1 and is_deleted = 0', |
|
154 | 1 | 'bind' => [Di::getDefault()->getUserData()->currentCompanyId(), Di::getDefault()->getApp()->getId()] |
|
155 | ]); |
||
156 | |||
157 | if (!is_object($subscription)) { |
||
158 | throw new ServerErrorHttpException(_('No active subscription for this app ' . Di::getDefault()->getApp()->getId() . ' at the company ' . Di::getDefault()->getUserData()->currentCompanyId())); |
||
159 | } |
||
160 | |||
161 | return $subscription; |
||
162 | } |
||
164 |