We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -30,36 +30,36 @@ |
||
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - //for update form, get initial state of the entity |
|
| 34 | - if (isset($id) && $id) { |
|
| 33 | + //for update form, get initial state of the entity |
|
| 34 | + if (isset($id) && $id) { |
|
| 35 | 35 | |
| 36 | 36 | //get entity with relations for primary dependency |
| 37 | - $entity_dependencies = $entity_model->with($primary_dependency['entity']) |
|
| 38 | - ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary']) |
|
| 39 | - ->find($id); |
|
| 37 | + $entity_dependencies = $entity_model->with($primary_dependency['entity']) |
|
| 38 | + ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary']) |
|
| 39 | + ->find($id); |
|
| 40 | 40 | |
| 41 | - $secondaries_from_primary = []; |
|
| 41 | + $secondaries_from_primary = []; |
|
| 42 | 42 | |
| 43 | - //convert relation in array |
|
| 44 | - $primary_array = $entity_dependencies->{$primary_dependency['entity']}->toArray(); |
|
| 43 | + //convert relation in array |
|
| 44 | + $primary_array = $entity_dependencies->{$primary_dependency['entity']}->toArray(); |
|
| 45 | 45 | |
| 46 | - $secondary_ids = []; |
|
| 46 | + $secondary_ids = []; |
|
| 47 | 47 | |
| 48 | - //create secondary dependency from primary relation, used to check what checkbox must be checked from second checklist |
|
| 49 | - if (old($primary_dependency['name'])) { |
|
| 50 | - foreach (old($primary_dependency['name']) as $primary_item) { |
|
| 51 | - foreach ($dependencyArray[$primary_item] as $second_item) { |
|
| 52 | - $secondary_ids[$second_item] = $second_item; |
|
| 53 | - } |
|
| 54 | - } |
|
| 55 | - } else { //create dependencies from relation if not from validate error |
|
| 56 | - foreach ($primary_array as $primary_item) { |
|
| 57 | - foreach ($primary_item[$secondary_dependency['entity']] as $second_item) { |
|
| 58 | - $secondary_ids[$second_item['id']] = $second_item['id']; |
|
| 59 | - } |
|
| 60 | - } |
|
| 61 | - } |
|
| 62 | - } |
|
| 48 | + //create secondary dependency from primary relation, used to check what checkbox must be checked from second checklist |
|
| 49 | + if (old($primary_dependency['name'])) { |
|
| 50 | + foreach (old($primary_dependency['name']) as $primary_item) { |
|
| 51 | + foreach ($dependencyArray[$primary_item] as $second_item) { |
|
| 52 | + $secondary_ids[$second_item] = $second_item; |
|
| 53 | + } |
|
| 54 | + } |
|
| 55 | + } else { //create dependencies from relation if not from validate error |
|
| 56 | + foreach ($primary_array as $primary_item) { |
|
| 57 | + foreach ($primary_item[$secondary_dependency['entity']] as $second_item) { |
|
| 58 | + $secondary_ids[$second_item['id']] = $second_item['id']; |
|
| 59 | + } |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | 64 | //json encode of dependency matrix |
| 65 | 65 | $dependencyJson = json_encode($dependencyArray); |