/** * @return UpdateRowsDTO * @throws BinaryDataReaderException * @throws EventException * @throws JsonBinaryDecoderException * @throws MySQLReplicationException */ public function makeUpdateRowsDTO() { if (false === $this->rowInit()) { return null; } $columnsBinarySize = $this->getColumnsBinarySize($this->currentTableMap->getColumnsAmount()); $beforeBinaryData = $this->binaryDataReader->read($columnsBinarySize); $afterBinaryData = $this->binaryDataReader->read($columnsBinarySize); $values = []; while (false === $this->binaryDataReader->isComplete($this->eventInfo->getSizeNoHeader())) { $values[] = ['before' => $this->getColumnData($beforeBinaryData), 'after' => $this->getColumnData($afterBinaryData)]; } return new UpdateRowsDTO($this->eventInfo, $this->currentTableMap, count($values), $values); }
/** * @return string */ public function __toString() { return PHP_EOL . '=== Event ' . $this->getType() . ' === ' . PHP_EOL . 'Date: ' . $this->eventInfo->getDateTime() . PHP_EOL . 'Log position: ' . $this->eventInfo->getPos() . PHP_EOL . 'Event size: ' . $this->eventInfo->getSize() . PHP_EOL . 'Table: ' . $this->tableMap->getTable() . PHP_EOL . 'Affected columns: ' . $this->tableMap->getColumnsAmount() . PHP_EOL . 'Changed rows: ' . $this->changedRows . PHP_EOL . 'Values: ' . print_r($this->values, true) . PHP_EOL; }
/** * @return string */ public function __toString() { return PHP_EOL . '=== Event ' . $this->getType() . ' === ' . PHP_EOL . 'Date: ' . $this->eventInfo->getDateTime() . PHP_EOL . 'Log position: ' . $this->eventInfo->getPos() . PHP_EOL . 'Event size: ' . $this->eventInfo->getSize() . PHP_EOL . 'Table: ' . $this->tableMap->getTable() . PHP_EOL . 'Database: ' . $this->tableMap->getDatabase() . PHP_EOL . 'Table Id: ' . $this->tableMap->getTableId() . PHP_EOL . 'Columns amount: ' . $this->tableMap->getColumnsAmount() . PHP_EOL; }