1 | <?php |
||
34 | class SqlStatementRepository extends \TechDivision\Import\Product\Repositories\SqlStatementRepository |
||
35 | { |
||
36 | |||
37 | /** |
||
38 | * The SQL statements. |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | private $statements = array( |
||
|
|||
43 | SqlStatementKeys::CREATE_URL_REWRITE => |
||
44 | 'INSERT |
||
45 | INTO url_rewrite |
||
46 | (entity_type, |
||
47 | entity_id, |
||
48 | request_path, |
||
49 | target_path, |
||
50 | redirect_type, |
||
51 | store_id, |
||
52 | description, |
||
53 | is_autogenerated, |
||
54 | metadata) |
||
55 | VALUES (:entity_type, |
||
56 | :entity_id, |
||
57 | :request_path, |
||
58 | :target_path, |
||
59 | :redirect_type, |
||
60 | :store_id, |
||
61 | :description, |
||
62 | :is_autogenerated, |
||
63 | :metadata)', |
||
64 | SqlStatementKeys::UPDATE_URL_REWRITE => |
||
65 | 'UPDATE url_rewrite |
||
66 | SET entity_type = :entity_type, |
||
67 | entity_id = :entity_id, |
||
68 | request_path = :request_path, |
||
69 | target_path = :target_path, |
||
70 | redirect_type = :redirect_type, |
||
71 | store_id = :store_id, |
||
72 | description = :description, |
||
73 | is_autogenerated = :is_autogenerated, |
||
74 | metadata = :metadata |
||
75 | WHERE url_rewrite_id = :url_rewrite_id', |
||
76 | SqlStatementKeys::CREATE_URL_REWRITE_PRODUCT_CATEGORY => |
||
77 | 'INSERT |
||
78 | INTO catalog_url_rewrite_product_category |
||
79 | (url_rewrite_id, |
||
80 | category_id, |
||
81 | product_id) |
||
82 | VALUES (:url_rewrite_id, |
||
83 | :category_id, |
||
84 | :product_id)', |
||
85 | SqlStatementKeys::UPDATE_URL_REWRITE_PRODUCT_CATEGORY => |
||
86 | 'UPDATE catalog_url_rewrite_product_category |
||
87 | SET category_id = :category_id, |
||
88 | product_id = :product_id |
||
89 | WHERE url_rewrite_id = :url_rewrite_id', |
||
90 | SqlStatementKeys::DELETE_URL_REWRITE_PRODUCT_CATEGORY => |
||
91 | 'DELETE |
||
92 | FROM catalog_url_rewrite_product_category |
||
93 | WHERE url_rewrite_id = :url_rewrite_id', |
||
94 | SqlStatementKeys::URL_REWRITE_PRODUCT_CATEGORY => |
||
95 | 'SELECT * |
||
96 | FROM catalog_url_rewrite_product_category |
||
97 | WHERE url_rewrite_id = :url_rewrite_id', |
||
98 | SqlStatementKeys::URL_REWRITES_BY_SKU => |
||
99 | 'SELECT t2.* |
||
100 | FROM catalog_product_entity t1, |
||
101 | url_rewrite t2 |
||
102 | WHERE t1.sku = :sku |
||
103 | AND t2.entity_id = t1.entity_id |
||
104 | AND t2.entity_type = \'product\'', |
||
105 | SqlStatementKeys::URL_REWRITE_PRODUCT_CATEGORIES_BY_SKU => |
||
106 | 'SELECT t3.* |
||
107 | FROM catalog_product_entity t1, |
||
108 | url_rewrite t2, |
||
109 | catalog_url_rewrite_product_category t3 |
||
110 | WHERE t1.sku = :sku |
||
111 | AND t2.entity_id = t1.entity_id |
||
112 | AND t2.entity_type = \'product\' |
||
113 | AND t3.url_rewrite_id = t2.url_rewrite_id' |
||
114 | ); |
||
115 | |||
116 | /** |
||
117 | * Initialize the the SQL statements. |
||
118 | */ |
||
119 | public function __construct() |
||
130 | } |
||
131 |