Skip to content

Commit

Permalink
Add support for accessing row data in the hook
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgav authored and ifsnop committed Oct 10, 2018
1 parent 98d53b6 commit d0bc71f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Ifsnop/Mysqldump/Mysqldump.php
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ private function prepareColumnValues($tableName, $row)
$ret = array();
$columnTypes = $this->tableColumnTypes[$tableName];
foreach ($row as $colName => $colValue) {
$colValue = $this->hookTransformColumnValue($tableName, $colName, $colValue);
$colValue = $this->hookTransformColumnValue($tableName, $colName, $colValue, $row);
$ret[] = $this->escape($colValue, $columnTypes[$colName]);
}

Expand Down Expand Up @@ -937,7 +937,7 @@ public function setTransformColumnValueHook($callable)
*
* @return string
*/
protected function hookTransformColumnValue($tableName, $colName, $colValue)
protected function hookTransformColumnValue($tableName, $colName, $colValue, $row)
{
if (! $this->transformColumnValueCallable) {
return $colValue;
Expand All @@ -947,6 +947,7 @@ protected function hookTransformColumnValue($tableName, $colName, $colValue)
$tableName,
$colName,
$colValue,
$row
));
}

Expand Down

0 comments on commit d0bc71f

Please sign in to comment.