@@ -233,7 +233,7 @@ |
||
233 | 233 | * Getting items with params |
234 | 234 | * |
235 | 235 | * @param array $params |
236 | - * @return array |
|
236 | + * @return Model[] |
|
237 | 237 | */ |
238 | 238 | public function getItems($params = []) { |
239 | 239 | $selectOptions = Ecommerce\OptionsParser::parse($params); |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | $favs = !empty($_COOKIE['ecommerce_favitems']) ? json_decode($_COOKIE['ecommerce_favitems'], true) : []; |
17 | 17 | if ($favs) { |
18 | 18 | foreach ($favs as $itemId) { |
19 | - $fav = \Ecommerce\Favorite::get([['user_id', Users\User::$cur->id], ['item_id', (int)$itemId]]); |
|
19 | + $fav = \Ecommerce\Favorite::get([['user_id', Users\User::$cur->id], ['item_id', (int) $itemId]]); |
|
20 | 20 | if (!$fav) { |
21 | - $item = \Ecommerce\Item::get((int)$itemId); |
|
21 | + $item = \Ecommerce\Item::get((int) $itemId); |
|
22 | 22 | if ($item) { |
23 | 23 | $fav = new \Ecommerce\Favorite([ |
24 | 24 | 'user_id' => Users\User::$cur->id, |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | public function getCurCart($create = true) { |
181 | 181 | $cart = false; |
182 | 182 | if (!empty($_SESSION['cart']['cart_id'])) { |
183 | - $cart = Ecommerce\Cart::get((int)$_SESSION['cart']['cart_id']); |
|
183 | + $cart = Ecommerce\Cart::get((int) $_SESSION['cart']['cart_id']); |
|
184 | 184 | } |
185 | 185 | if (!$cart && $create) { |
186 | 186 | $cart = new Ecommerce\Cart(); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $path = trim(implode('/', $args)); |
18 | 18 | |
19 | 19 | if (is_numeric($path)) { |
20 | - $material = Materials\Material::get([['id', (int)$path], ['date_publish', null, 'IS NOT']]); |
|
20 | + $material = Materials\Material::get([['id', (int) $path], ['date_publish', null, 'IS NOT']]); |
|
21 | 21 | } |
22 | 22 | if (!$material && $args) { |
23 | 23 | foreach ($args as $key => $alias) { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if ($category) { |
43 | 43 | $where = [ |
44 | 44 | ['category_id', $category->id], |
45 | - ['id', (int)$args[count($args) - 1]], |
|
45 | + ['id', (int) $args[count($args) - 1]], |
|
46 | 46 | ['date_publish', null, 'IS NOT'] |
47 | 47 | ]; |
48 | 48 | } else { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $path = trim(implode('/', $args)); |
76 | 76 | $category = null; |
77 | 77 | if (is_numeric($path)) { |
78 | - $category = Materials\Category::get((int)$path); |
|
78 | + $category = Materials\Category::get((int) $path); |
|
79 | 79 | } |
80 | 80 | if (!$category) { |
81 | 81 | foreach ($args as $alias) { |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $material = false; |
111 | 111 | if ($alias) { |
112 | 112 | if (is_numeric($alias)) { |
113 | - $material = Materials\Material::get([['id', (int)$alias], ['date_publish', null, 'IS NOT']]); |
|
113 | + $material = Materials\Material::get([['id', (int) $alias], ['date_publish', null, 'IS NOT']]); |
|
114 | 114 | } |
115 | 115 | if (!$material) { |
116 | 116 | $material = Materials\Material::get([['alias', $alias], ['date_publish', null, 'IS NOT']]); |