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