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::PRODUCT_RELATION => |
||
44 | 'SELECT * |
||
45 | FROM catalog_product_relation |
||
46 | WHERE parent_id = :parent_id |
||
47 | AND child_id = :child_id', |
||
48 | SqlStatementKeys::PRODUCT_SUPER_LINK => |
||
49 | 'SELECT * |
||
50 | FROM catalog_product_super_link |
||
51 | WHERE product_id = :product_id |
||
52 | AND parent_id = :parent_id', |
||
53 | SqlStatementKeys::PRODUCT_SUPER_ATTRIBUTE => |
||
54 | 'SELECT * |
||
55 | FROM catalog_product_super_attribute |
||
56 | WHERE product_id = :product_id |
||
57 | AND attribute_id = :attribute_id', |
||
58 | SqlStatementKeys::PRODUCT_SUPER_ATTRIBUTE_LABEL => |
||
59 | 'SELECT * |
||
60 | FROM catalog_product_super_attribute_label |
||
61 | WHERE product_super_attribute_id = :product_super_attribute_id |
||
62 | AND store_id = :store_id', |
||
63 | SqlStatementKeys::CREATE_PRODUCT_RELATION => |
||
64 | 'INSERT |
||
65 | INTO catalog_product_relation |
||
66 | (parent_id, |
||
67 | child_id) |
||
68 | VALUES (:parent_id, |
||
69 | :child_id)', |
||
70 | SqlStatementKeys::CREATE_PRODUCT_SUPER_LINK => |
||
71 | 'INSERT |
||
72 | INTO catalog_product_super_link |
||
73 | (product_id, |
||
74 | parent_id) |
||
75 | VALUES (:product_id, |
||
76 | :parent_id)', |
||
77 | SqlStatementKeys::CREATE_PRODUCT_SUPER_ATTRIBUTE => |
||
78 | 'INSERT |
||
79 | INTO catalog_product_super_attribute |
||
80 | (product_id, |
||
81 | attribute_id, |
||
82 | position) |
||
83 | VALUES (:product_id, |
||
84 | :attribute_id, |
||
85 | :position)', |
||
86 | SqlStatementKeys::UPDATE_PRODUCT_SUPER_ATTRIBUTE => |
||
87 | 'UPDATE catalog_product_super_attribute |
||
88 | SET product_id = :product_id, |
||
89 | attribute_id = :attribute_id, |
||
90 | position = :position |
||
91 | WHERE product_super_attribute_id = :product_super_attribute_id', |
||
92 | SqlStatementKeys::CREATE_PRODUCT_SUPER_ATTRIBUTE_LABEL => |
||
93 | 'INSERT |
||
94 | INTO catalog_product_super_attribute_label |
||
95 | (product_super_attribute_id, |
||
96 | store_id, |
||
97 | use_default, |
||
98 | value) |
||
99 | VALUES (:product_super_attribute_id, |
||
100 | :store_id, |
||
101 | :use_default, |
||
102 | :value)', |
||
103 | SqlStatementKeys::UPDATE_PRODUCT_SUPER_ATTRIBUTE_LABEL => |
||
104 | 'UPDATE catalog_product_super_attribute_label |
||
105 | SET product_super_attribute_id = :product_super_attribute_id, |
||
106 | store_id = :store_id, |
||
107 | use_default = :use_default, |
||
108 | value = :value |
||
109 | WHERE value_id = :value_id' |
||
110 | ); |
||
111 | |||
112 | /** |
||
113 | * Initialize the the SQL statements. |
||
114 | */ |
||
115 | public function __construct() |
||
126 | } |
||
127 |