Completed
Push — master ( 9b3686...89ef78 )
by Bernhard
07:29
created

SqlStatements::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * TechDivision\Import\Product\Magic360\Utils\SqlStatements
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @author    Bernhard Wick <[email protected]>
16
 * @copyright 2017 TechDivision GmbH <[email protected]>
17
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
 * @link      https://github.com/techdivision/import-product-magic360
19
 * @link      http://www.techdivision.com
20
 */
21
22
namespace TechDivision\Import\Product\Magic360\Utils;
23
24
/**
25
 * Collection of SQL statements used for data manipulation.
26
 *
27
 * @author    Tim Wagner <[email protected]>
28
 * @author    Bernhard Wick <[email protected]>
29
 * @copyright 2017 TechDivision GmbH <[email protected]>
30
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
31
 * @link      https://github.com/techdivision/import-product-magic360
32
 * @link      http://www.techdivision.com
33
 */
34
class SqlStatements
35
{
36
37
    /**
38
     * This is a utility class, so protect it against direct
39
     * instantiation.
40
     */
41
    private function __construct()
42
    {
43
    }
44
45
    /**
46
     * This is a utility class, so protect it against cloning.
47
     *
48
     * @return void
49
     */
50
    private function __clone()
51
    {
52
    }
53
54
    /**
55
     * The SQL statement to load an existing magic360 gallery byproduct ID and position.
56
     *
57
     * @var string MAGIC360_GALLERY
58
     */
59
    const MAGIC360_GALLERY = 'SELECT *
60
                                     FROM magic360_gallery
61
                                    WHERE product_id = :product_id
62
                                      AND position = :position';
63
64
    /**
65
     * The SQL statement to load an existing magic360 column by product ID.
66
     *
67
     * @var string MAGIC360_COLUMNS
68
     */
69
    const MAGIC360_COLUMNS = 'SELECT *
70
                                           FROM magic360_columns
71
                                          WHERE product_id = :product_id';
72
73
    /**
74
     * The SQL statement to create a new magic360 gallery entry.
75
     *
76
     * @var string CREATE_MAGIC360_GALLERY
77
     */
78
    const CREATE_MAGIC360_GALLERY = 'INSERT
79
                                            INTO magic360_gallery (
80
                                                     product_id,
81
                                                     position,
82
                                                     file
83
                                                   )
84
                                            VALUES (:product_id,
85
                                                    :position,
86
                                                    :file)';
87
88
    /**
89
     * The SQL statement to update an existing magic360 gallery entry.
90
     *
91
     * @var string UPDATE_MAGIC360_GALLERY
92
     */
93
    const UPDATE_MAGIC360_GALLERY = 'UPDATE magic360_gallery
94
                                             SET product_id = :product_id,
95
                                                 position = :position,
96
                                                 file = :file
97
                                           WHERE id = :id';
98
99
    /**
100
     * The SQL statement to delete an existing magic360 gallery entry.
101
     *
102
     * @var string DELETE_MAGIC360_GALLERY
103
     */
104
    const DELETE_MAGIC360_GALLERY = 'DELETE FROM magic360_gallery WHERE product_id = :product_id';
105
106
    /**
107
     * The SQL statement to create a new magic360 column entry.
108
     *
109
     * @var string CREATE_MAGIC360_COLUMNS
110
     */
111
    const CREATE_MAGIC360_COLUMNS = 'INSERT
112
                                                  INTO magic360_columns (
113
                                                           product_id,
114
                                                           columns
115
                                                       )
116
                                                VALUES (:product_id,
117
                                                        :columns)';
118
119
    /**
120
     * The SQL statement to update an existing magic360 column entry.
121
     *
122
     * @var string UPDATE_MAGIC360_COLUMNS
123
     */
124
    const UPDATE_MAGIC360_COLUMNS = 'UPDATE magic360_columns
125
                                                   SET product_id = :product_id,
126
                                                       columns = :columns
127
                                                 WHERE product_id = :product_id';
128
129
    /**
130
     * The SQL statement to update an existing magic360 column entry.
131
     *
132
     * @var string DELETE_MAGIC360_COLUMNS
133
     */
134
    const DELETE_MAGIC360_COLUMNS = 'DELETE FROM magic360_columns WHERE product_id = :product_id';
135
}
136