1 | <?php |
||
34 | class SqlStatements extends AbstractSqlStatements |
||
35 | { |
||
36 | |||
37 | /** |
||
38 | * The SQL statement to load an existing product link by product/linked product/link type ID. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | const PRODUCT_LINK = 'product_link'; |
||
43 | |||
44 | /** |
||
45 | * The SQL statement to load an existing product link attribute integer value by the passed product link attribute ID/link ID/value. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | const PRODUCT_LINK_ATTRIBUTE_INT = 'product_link_attribute_int'; |
||
50 | |||
51 | /** |
||
52 | * The SQL statement to create a new product link. |
||
53 | * |
||
54 | * @var string |
||
55 | */ |
||
56 | const CREATE_PRODUCT_LINK = 'insert.product_link'; |
||
57 | |||
58 | /** |
||
59 | * The SQL statement to update an existing product link. |
||
60 | * |
||
61 | * @var string |
||
62 | */ |
||
63 | const UPDATE_PRODUCT_LINK = 'update.product_link'; |
||
64 | |||
65 | /** |
||
66 | * The SQL statement to create a new product link attribute integer value. |
||
67 | * |
||
68 | * @var string |
||
69 | */ |
||
70 | const CREATE_PRODUCT_LINK_ATTRIBUTE_INT = 'insert:product_link_attribute_int'; |
||
71 | |||
72 | /** |
||
73 | * The SQL statement to update an existing product link attribute integer value. |
||
74 | * |
||
75 | * @var string |
||
76 | */ |
||
77 | const UPDATE_PRODUCT_LINK_ATTRIBUTE_INT = 'update.product_link_attribute_int'; |
||
78 | |||
79 | /** |
||
80 | * The SQL statements. |
||
81 | * |
||
82 | * @var array |
||
83 | */ |
||
84 | private $statements = array( |
||
85 | SqlStatements::PRODUCT_LINK => |
||
86 | 'SELECT * |
||
87 | FROM catalog_product_link |
||
88 | WHERE product_id = :product_id |
||
89 | AND linked_product_id = :linked_product_id |
||
90 | AND link_type_id = :link_type_id', |
||
91 | SqlStatements::PRODUCT_LINK_ATTRIBUTE_INT => |
||
92 | 'SELECT * |
||
93 | FROM catalog_product_link_attribute_int |
||
94 | WHERE product_link_attribute_id = :product_link_attribute_id |
||
95 | AND link_id = :link_id', |
||
96 | SqlStatements::CREATE_PRODUCT_LINK => |
||
97 | 'INSERT |
||
98 | INTO catalog_product_link |
||
99 | (product_id, |
||
100 | linked_product_id, |
||
101 | link_type_id) |
||
102 | VALUES (:product_id, |
||
103 | :linked_product_id, |
||
104 | :link_type_id)', |
||
105 | SqlStatements::UPDATE_PRODUCT_LINK => |
||
106 | 'UPDATE catalog_product_link |
||
107 | SET product_id = :product_id, |
||
108 | linked_product_id = :linked_product_id, |
||
109 | link_type_id = :link_type_id |
||
110 | WHERE link_id = :link_id', |
||
111 | SqlStatements::CREATE_PRODUCT_LINK_ATTRIBUTE_INT => |
||
112 | 'INSERT |
||
113 | INTO catalog_product_link_attribute_int |
||
114 | (product_link_attribute_id, |
||
115 | link_id, |
||
116 | value) |
||
117 | VALUES (:product_link_attribute_id, |
||
118 | :link_id, |
||
119 | :value)', |
||
120 | SqlStatements::UPDATE_PRODUCT_LINK_ATTRIBUTE_INT => |
||
121 | 'UPDATE catalog_product_link_attribute_int |
||
122 | SET product_link_attribute_id = :product_link_attribute_id, |
||
123 | link_id = :link_id, |
||
124 | value = :value |
||
125 | WHERE value_id = :value_id' |
||
126 | ); |
||
127 | |||
128 | /** |
||
129 | * Initialize the the SQL statements. |
||
130 | */ |
||
131 | public function __construct() |
||
139 | } |
||
140 |