Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
49 | 4 | public static function getActiveForThisApp() : Subscription |
|
50 | { |
||
51 | 4 | $subscription = self::findFirst([ |
|
52 | 4 | 'conditions' => 'company_id = ?0 and apps_id = ?1 and is_deleted = 0', |
|
53 | 4 | 'bind' => [Di::getDefault()->getUserData()->default_company, Di::getDefault()->getApp()->getId()] |
|
54 | ]); |
||
55 | |||
56 | 4 | if (!is_object($subscription)) { |
|
57 | 2 | throw new ServerErrorHttpException(_('No active subscription for this app ' . Di::getDefault()->getApp()->getId() . ' at the company ' . Di::getDefault()->getUserData()->default_company)); |
|
58 | } |
||
59 | |||
60 | 2 | return $subscription; |
|
1 ignored issue
–
show
|
|||
61 | } |
||
63 |