1 | <?php |
||
36 | class SqlStatements extends AbstractSqlStatements |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * The SQL statement to load an existing magic360 gallery byproduct ID and position. |
||
41 | * |
||
42 | * @var string MAGIC360_GALLERY |
||
43 | */ |
||
44 | const MAGIC360_GALLERY = 'magic360_gallery'; |
||
45 | |||
46 | /** |
||
47 | * The SQL statement to load an existing magic360 column by product ID. |
||
48 | * |
||
49 | * @var string MAGIC360_COLUMNS |
||
50 | */ |
||
51 | const MAGIC360_COLUMNS = 'magic360_colums'; |
||
52 | |||
53 | /** |
||
54 | * The SQL statement to create a new magic360 gallery entry. |
||
55 | * |
||
56 | * @var string CREATE_MAGIC360_GALLERY |
||
57 | */ |
||
58 | const CREATE_MAGIC360_GALLERY = 'create.magic360_gallery'; |
||
59 | |||
60 | /** |
||
61 | * The SQL statement to update an existing magic360 gallery entry. |
||
62 | * |
||
63 | * @var string UPDATE_MAGIC360_GALLERY |
||
64 | */ |
||
65 | const UPDATE_MAGIC360_GALLERY = 'update.magic360_gallery'; |
||
66 | |||
67 | /** |
||
68 | * The SQL statement to delete an existing magic360 gallery entry. |
||
69 | * |
||
70 | * @var string DELETE_MAGIC360_GALLERY |
||
71 | */ |
||
72 | const DELETE_MAGIC360_GALLERY = 'delete.magic360_gallery'; |
||
73 | |||
74 | /** |
||
75 | * The SQL statement to create a new magic360 column entry. |
||
76 | * |
||
77 | * @var string CREATE_MAGIC360_COLUMNS |
||
78 | */ |
||
79 | const CREATE_MAGIC360_COLUMNS = 'create.magic360_columns'; |
||
80 | |||
81 | /** |
||
82 | * The SQL statement to update an existing magic360 column entry. |
||
83 | * |
||
84 | * @var string UPDATE_MAGIC360_COLUMNS |
||
85 | */ |
||
86 | const UPDATE_MAGIC360_COLUMNS = 'update.magic360_columns'; |
||
87 | |||
88 | /** |
||
89 | * The SQL statement to update an existing magic360 column entry. |
||
90 | * |
||
91 | * @var string DELETE_MAGIC360_COLUMNS |
||
92 | */ |
||
93 | const DELETE_MAGIC360_COLUMNS = 'delete.magic360_columns'; |
||
94 | |||
95 | /** |
||
96 | * The SQL statements. |
||
97 | * |
||
98 | * @var array |
||
99 | */ |
||
100 | private $statements = array( |
||
101 | SqlStatements::MAGIC360_GALLERY => |
||
102 | 'SELECT * |
||
103 | FROM magic360_gallery |
||
104 | WHERE product_id = :product_id |
||
105 | AND position = :position', |
||
106 | SqlStatements::MAGIC360_COLUMNS => |
||
107 | 'SELECT * |
||
108 | FROM magic360_columns |
||
109 | WHERE product_id = :product_id', |
||
110 | SqlStatements::CREATE_MAGIC360_GALLERY => |
||
111 | 'INSERT |
||
112 | INTO magic360_gallery |
||
113 | (product_id, |
||
114 | position, |
||
115 | file) |
||
116 | VALUES (:product_id, |
||
117 | :position, |
||
118 | :file)', |
||
119 | SqlStatements::UPDATE_MAGIC360_GALLERY => |
||
120 | 'UPDATE magic360_gallery |
||
121 | SET product_id = :product_id, |
||
122 | position = :position, |
||
123 | file = :file |
||
124 | WHERE id = :id', |
||
125 | SqlStatements::DELETE_MAGIC360_GALLERY => |
||
126 | 'DELETE FROM magic360_gallery WHERE product_id = :product_id', |
||
127 | SqlStatements::CREATE_MAGIC360_COLUMNS => |
||
128 | 'INSERT |
||
129 | INTO magic360_columns |
||
130 | (product_id, |
||
131 | columns) |
||
132 | VALUES (:product_id, |
||
133 | :columns)', |
||
134 | SqlStatements::UPDATE_MAGIC360_COLUMNS => |
||
135 | 'UPDATE magic360_columns |
||
136 | SET product_id = :product_id, |
||
137 | columns = :columns |
||
138 | WHERE product_id = :product_id', |
||
139 | SqlStatements::DELETE_MAGIC360_COLUMNS => |
||
140 | 'DELETE FROM magic360_columns WHERE product_id = :product_id', |
||
141 | ); |
||
142 | |||
143 | /** |
||
144 | * Initialize the the SQL statements. |
||
145 | */ |
||
146 | public function __construct() |
||
154 | } |
||
155 |