1 | <?php |
||
37 | class SqlStatementRepository extends AbstractSqlStatementRepository |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * The SQL statements. |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | private $statements = array( |
||
46 | SqlStatementKeys::MAGIC360_GALLERY => |
||
47 | 'SELECT * |
||
48 | FROM magic360_gallery |
||
49 | WHERE product_id = :product_id |
||
50 | AND position = :position', |
||
51 | SqlStatementKeys::MAGIC360_COLUMNS => |
||
52 | 'SELECT * |
||
53 | FROM magic360_columns |
||
54 | WHERE product_id = :product_id', |
||
55 | SqlStatementKeys::CREATE_MAGIC360_GALLERY => |
||
56 | 'INSERT |
||
57 | INTO magic360_gallery |
||
58 | (product_id, |
||
59 | position, |
||
60 | file) |
||
61 | VALUES (:product_id, |
||
62 | :position, |
||
63 | :file)', |
||
64 | SqlStatementKeys::UPDATE_MAGIC360_GALLERY => |
||
65 | 'UPDATE magic360_gallery |
||
66 | SET product_id = :product_id, |
||
67 | position = :position, |
||
68 | file = :file |
||
69 | WHERE id = :id', |
||
70 | SqlStatementKeys::DELETE_MAGIC360_GALLERY => |
||
71 | 'DELETE FROM magic360_gallery WHERE product_id = :product_id', |
||
72 | SqlStatementKeys::CREATE_MAGIC360_COLUMNS => |
||
73 | 'INSERT |
||
74 | INTO magic360_columns |
||
75 | (product_id, |
||
76 | columns) |
||
77 | VALUES (:product_id, |
||
78 | :columns)', |
||
79 | SqlStatementKeys::UPDATE_MAGIC360_COLUMNS => |
||
80 | 'SqlStatementKeys magic360_columns |
||
81 | SET product_id = :product_id, |
||
82 | columns = :columns |
||
83 | WHERE product_id = :product_id', |
||
84 | SqlStatementKeys::DELETE_MAGIC360_COLUMNS => |
||
85 | 'DELETE FROM magic360_columns WHERE product_id = :product_id', |
||
86 | ); |
||
87 | |||
88 | /** |
||
89 | * Initialize the the SQL statements. |
||
90 | */ |
||
91 | public function __construct() |
||
99 | } |
||
100 |