Skip to content

Commit 2055c25

Browse files
committed
Merge branch 'MAGETWO-63634' of github.com:magento-troll/magento2ce into MAGETWO-58456
2 parents 5a39814 + 33fa6d0 commit 2055c25

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

lib/internal/Magento/Framework/DB/FieldDataConverter.php

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Framework\DB\Query\Generator;
1010
use Magento\Framework\DB\DataConverter\DataConverterInterface;
1111
use Magento\Framework\DB\Select\QueryModifierInterface;
12+
use Magento\Framework\DB\Select;
1213

1314
/**
1415
* Convert field data from one representation to another
@@ -40,16 +41,17 @@ public function __construct(
4041
}
4142

4243
/**
43-
* Convert field data from one representation to another
44+
* Get converter select
4445
*
4546
* @param AdapterInterface $connection
4647
* @param string $table
4748
* @param string $identifier
4849
* @param string $field
4950
* @param QueryModifierInterface|null $queryModifier
50-
* @return void
51+
*
52+
* @return Select
5153
*/
52-
public function convert(
54+
public function getSelect(
5355
AdapterInterface $connection,
5456
$table,
5557
$identifier,
@@ -62,6 +64,28 @@ public function convert(
6264
if ($queryModifier) {
6365
$queryModifier->modify($select);
6466
}
67+
68+
return $select;
69+
}
70+
71+
/**
72+
* Convert table field data from one representation to another uses DataConverterInterface
73+
*
74+
* @param AdapterInterface $connection
75+
* @param string $table
76+
* @param string $identifier
77+
* @param string $field
78+
* @param QueryModifierInterface|null $queryModifier
79+
* @return void
80+
*/
81+
public function convert(
82+
AdapterInterface $connection,
83+
$table,
84+
$identifier,
85+
$field,
86+
QueryModifierInterface $queryModifier = null
87+
) {
88+
$select = $this->getSelect($connection, $table, $identifier, $field, $queryModifier);
6589
$iterator = $this->queryGenerator->generate($identifier, $select);
6690
foreach ($iterator as $selectByRange) {
6791
$rows = $connection->fetchAll($selectByRange);

0 commit comments

Comments
 (0)