summaryrefslogtreecommitdiff
path: root/public/app/models/market/Product_model.php
diff options
context:
space:
mode:
Diffstat (limited to 'public/app/models/market/Product_model.php')
-rw-r--r--public/app/models/market/Product_model.php49
1 files changed, 0 insertions, 49 deletions
diff --git a/public/app/models/market/Product_model.php b/public/app/models/market/Product_model.php
deleted file mode 100644
index aa554a1..0000000
--- a/public/app/models/market/Product_model.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-namespace app\models\market;
-
-use \Registry;
-use app\models\market\Market_repository as Market;
-
-class Product_model
-{
- public static function fromUrl($url, $store = 904)
- {
- $product = Registry::use('database')->query(
- Market::pull('Active_PRODUCT_by:storeID_ProductUrl'),
- [
- ':storeID' => $store,
- ':ProductUrl' => $url
- ]
- )->getFirst();
-
- // if no product, return false
- if ($product === false) return false;
-
- // inject product's images
- $product['Images'] = self::getProductImages($product['ID']);
-
- return $product;
- }
-
-
- public static function getProductImages($id)
- {
- ## return Registry::use('database')->runQuery(
- ## "SELECT a.Url, a.Title, a.Description
- ## FROM products p
- ## LEFT JOIN products_to_images p2i ON p2i.SimpleProductID = p.ID
- ## LEFT JOIN assets a ON a.ID = p2i.ImageID
- ## WHERE p.IsActive = 1 AND p.Published = 1
- ## AND p.ID = :id
- ## ORDER BY p2i.Order",
- ## [ ':id' => $id ]
- ## );
-
- return Registry::use('database')->runQuery(
- Market::pull('PRODUCT_IMAGES_by:productID'),
- ['productID' => $id ]
- );
- }
-
-} \ No newline at end of file