1
|
|
|
<?php |
2
|
|
|
/*************************************************************************************/ |
3
|
|
|
/* This file is part of the Thelia package. */ |
4
|
|
|
/* */ |
5
|
|
|
/* email : [email protected] */ |
6
|
|
|
/* web : http://www.thelia.net */ |
7
|
|
|
/* */ |
8
|
|
|
/* file that was distributed with this source code. */ |
9
|
|
|
/*************************************************************************************/ |
10
|
|
|
|
11
|
|
|
namespace Thelia\ImportExport\Export\Type; |
12
|
|
|
|
13
|
|
|
use Propel\Runtime\ActiveQuery\Criteria; |
14
|
|
|
use Propel\Runtime\ActiveQuery\Join; |
15
|
|
|
use Thelia\ImportExport\Export\AbstractExport; |
16
|
|
|
use Thelia\Model\Map\ProductI18nTableMap; |
|
|
|
|
17
|
|
|
use Thelia\Model\Map\ProductTableMap; |
|
|
|
|
18
|
|
|
use Thelia\Model\ProductQuery; |
19
|
|
|
|
20
|
|
|
|
21
|
|
|
class ProductI18nExport extends AbstractExport |
22
|
|
|
{ |
23
|
|
|
const FILE_NAME = 'product_i18n'; |
24
|
|
|
|
25
|
|
|
protected $orderAndAliases = [ |
26
|
|
|
ProductTableMap::REF => 'ref', |
27
|
|
|
'product_i18n_TITLE' => 'product_title', |
28
|
|
|
'product_i18n_CHAPO' => 'product_chapo', |
29
|
|
|
'product_i18n_DESCRIPTION' => 'product_description', |
30
|
|
|
'product_i18n_POSTSCRIPTUM' => 'product_postscriptum', |
31
|
|
|
]; |
32
|
|
|
|
33
|
|
|
protected $idxStripHtml = [ |
34
|
|
|
'product_i18n_CHAPO', |
35
|
|
|
'product_i18n_DESCRIPTION', |
36
|
|
|
'product_i18n_POSTSCRIPTUM', |
37
|
|
|
]; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @return array|Criteria|\Propel\Runtime\ActiveQuery\ModelCriteria |
41
|
|
|
* @throws \Propel\Runtime\Exception\PropelException |
42
|
|
|
*/ |
43
|
|
|
public function getData() |
44
|
|
|
{ |
45
|
|
|
$locale = $this->language->getLocale(); |
46
|
|
|
|
47
|
|
|
$productJoin = new Join( |
48
|
|
|
ProductTableMap::ID, |
49
|
|
|
ProductI18nTableMap::ID, |
50
|
|
|
Criteria::LEFT_JOIN |
51
|
|
|
); |
52
|
|
|
|
53
|
|
|
$query = ProductQuery::create() |
54
|
|
|
->addSelfSelectColumns() |
55
|
|
|
->addJoinObject($productJoin, 'product_join') |
56
|
|
|
->addJoinCondition( |
57
|
|
|
'product_join', |
58
|
|
|
ProductI18nTableMap::LOCALE . ' = ?', $locale, |
59
|
|
|
null, |
60
|
|
|
\PDO::PARAM_STR |
61
|
|
|
) |
62
|
|
|
->addAsColumn('product_i18n_TITLE', ProductI18nTableMap::TITLE) |
63
|
|
|
->addAsColumn('product_i18n_CHAPO', ProductI18nTableMap::CHAPO) |
64
|
|
|
->addAsColumn('product_i18n_DESCRIPTION', ProductI18nTableMap::DESCRIPTION) |
65
|
|
|
->addAsColumn('product_i18n_POSTSCRIPTUM', ProductI18nTableMap::POSTSCRIPTUM); |
66
|
|
|
|
67
|
|
|
return $query; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @param array $data |
72
|
|
|
* @return array |
73
|
|
|
*/ |
74
|
|
|
public function beforeSerialize(array $data) |
75
|
|
|
{ |
76
|
|
|
foreach ($data as $idx => &$value) { |
77
|
|
|
if (in_array($idx, $this->idxStripHtml) && !empty($value)) { |
78
|
|
|
$value = strip_tags($value); |
79
|
|
|
|
80
|
|
|
$value = html_entity_decode($value, ENT_QUOTES, 'UTF-8'); |
81
|
|
|
} |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
return parent::beforeSerialize($data); |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
|
88
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths