| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 71 | private function removePreviousImage($vendor) |
||
| 72 | { |
||
| 73 | $images = $vendor->images; // Incoming array of images |
||
| 74 | //, but for categories can exists only one image |
||
| 75 | |||
| 76 | if(count($images)) |
||
| 77 | $images->each(function(Image $image){ |
||
| 78 | $image->delete(); |
||
| 79 | // remove image. |
||
| 80 | // @events: deleted(); remove file |
||
| 81 | }); |
||
| 82 | |||
| 83 | |||
| 84 | } |
||
| 85 | } |