| Conditions | 4 |
| Paths | 4 |
| Total Lines | 9 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function addObjectDeletionChecksOnJoin(\yii\db\Query $query, $tables, $join='innerJoin') |
||
| 22 | { |
||
| 23 | foreach ($tables as $table) { |
||
| 24 | if ($join == 'innerJoin') { |
||
| 25 | $query->innerJoin("dds_object {$table}Obj", "{$table}Obj._uuid = {$table}._uuid"); |
||
| 26 | $query->andWhere("({$table}Obj._deleted = 0)"); |
||
| 27 | } else if ($join == 'leftJoin') { |
||
| 28 | $query->leftJoin("dds_object {$table}Obj", "{$table}Obj._uuid = {$table}._uuid"); |
||
| 29 | $query->andWhere("({$table}Obj._deleted IS NULL || {$table}Obj._deleted = 0)"); |
||
| 30 | } |
||
| 33 | } |