Skip to content

Commit b44d68e

Browse files
committed
Simplify getUsedBy() in Packet View controller
1 parent 4579124 commit b44d68e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/controllers/Packet/View.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ public function &run(Router &$router, ViewLib &$view, array &$args) {
3232
Comment::PARENT_TYPE_PACKET,
3333
$model->packet_id
3434
);
35-
$model->used_by = $this->getUsedBy($model->packet);
35+
$model->used_by = Product::getProductsFromIds(
36+
$model->packet->getUsedBy()
37+
);
3638
} else {
3739
$model->used_by = null;
3840
}
@@ -47,9 +49,4 @@ public function &run(Router &$router, ViewLib &$view, array &$args) {
4749

4850
}
4951

50-
protected function getUsedBy(Packet &$packet) {
51-
if (is_null($packet)) return null;
52-
return Product::getProductsFromIds($packet->getUsedBy());
53-
}
54-
5552
}

0 commit comments

Comments
 (0)