| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public static function getOrganization($organization) |
||
| 34 | { |
||
| 35 | if (!$organization) { |
||
| 36 | return null; |
||
| 37 | } |
||
| 38 | $class = Yii::$app->user->identity->organizationClass; |
||
| 39 | if ($organization instanceof $class) { |
||
| 40 | $organization = $organization->getID(); |
||
| 41 | } |
||
| 42 | return $class::find()->guidOrId($organization)->one(); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |