1 | <?php |
||
32 | class SqlStatements extends \TechDivision\Import\Utils\SqlStatements |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * The SQL statement to load all available categories. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | const CATEGORIES = 'categories'; |
||
41 | |||
42 | /** |
||
43 | * The SQL statement to load the category varchars for a list of entity IDs. |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | const CATEGORY_VARCHARS_BY_ENTITY_IDS = 'category_varchars.by.entity_ids'; |
||
48 | |||
49 | /** |
||
50 | * The SQL statements. |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | private $statements = array( |
||
|
|||
55 | SqlStatements::CATEGORIES => |
||
56 | 'SELECT t0.*, |
||
57 | (SELECT `value` |
||
58 | FROM eav_attribute t1, catalog_category_entity_varchar t2 |
||
59 | WHERE t1.attribute_code = \'name\' |
||
60 | AND t1.entity_type_id = 3 |
||
61 | AND t2.attribute_id = t1.attribute_id |
||
62 | AND t2.store_id = 0 |
||
63 | AND t2.row_id = t0.row_id) AS name, |
||
64 | (SELECT `value` |
||
65 | FROM eav_attribute t1, catalog_category_entity_varchar t2 |
||
66 | WHERE t1.attribute_code = \'url_key\' |
||
67 | AND t1.entity_type_id = 3 |
||
68 | AND t2.attribute_id = t1.attribute_id |
||
69 | AND t2.store_id = 0 |
||
70 | AND t2.row_id = t0.row_id) AS url_key, |
||
71 | (SELECT `value` |
||
72 | FROM eav_attribute t1, catalog_category_entity_varchar t2 |
||
73 | WHERE t1.attribute_code = \'url_path\' |
||
74 | AND t1.entity_type_id = 3 |
||
75 | AND t2.attribute_id = t1.attribute_id |
||
76 | AND t2.store_id = 0 |
||
77 | AND t2.row_id = t0.row_id) AS url_path |
||
78 | FROM catalog_category_entity AS t0', |
||
79 | SqlStatements::CATEGORY_VARCHARS_BY_ENTITY_IDS => |
||
80 | 'SELECT t1.* |
||
81 | FROM catalog_category_entity AS t0 |
||
82 | INNER JOIN catalog_category_entity_varchar AS t1 |
||
83 | ON t1.row_id = t0.row_id |
||
84 | INNER JOIN eav_attribute AS t2 |
||
85 | ON t2.entity_type_id = 3 |
||
86 | AND t2.attribute_code = \'name\' |
||
87 | AND t1.attribute_id = t2.attribute_id |
||
88 | AND t1.store_id = 0 |
||
89 | AND t0.entity_id IN (?)' |
||
90 | ); |
||
91 | |||
92 | /** |
||
93 | * Initialize the the SQL statements. |
||
94 | */ |
||
95 | public function __construct() |
||
106 | } |
||
107 |