Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Entity\SyncJobs and refactor code. #135

Merged
merged 1 commit into from
Feb 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
270 changes: 0 additions & 270 deletions Entity/SyncJob.php

This file was deleted.

12 changes: 6 additions & 6 deletions Sync/DiffProvider/Binlog/BinlogParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace ONGR\ConnectionsBundle\Sync\DiffProvider\Binlog;

use ONGR\ConnectionsBundle\Entity\SyncJob;
use ONGR\ConnectionsBundle\Sync\ActionTypes;

/**
* Parses binary log data (Interpreter).
Expand Down Expand Up @@ -225,11 +225,11 @@ protected function parseQuery()

$this->getNextLine(self::LINE_TYPE_QUERY);

if ($buffer['type'] == SyncJob::TYPE_DELETE || $buffer['type'] === SyncJob::TYPE_UPDATE) {
if ($buffer['type'] == ActionTypes::DELETE || $buffer['type'] === ActionTypes::UPDATE) {
$buffer['where'] = $this->handleStatement($this->lastLine, self::STATEMENT_TYPE_WHERE);
}

if ($buffer['type'] == SyncJob::TYPE_CREATE || $buffer['type'] === SyncJob::TYPE_UPDATE) {
if ($buffer['type'] == ActionTypes::CREATE || $buffer['type'] === ActionTypes::UPDATE) {
$buffer['set'] = $this->handleStatement($this->lastLine, self::STATEMENT_TYPE_SET);
}

Expand Down Expand Up @@ -487,11 +487,11 @@ protected function detectQueryType($type)
{
switch ($type) {
case 'INSERT INTO':
return SyncJob::TYPE_CREATE;
return ActionTypes::CREATE;
case 'UPDATE':
return SyncJob::TYPE_UPDATE;
return ActionTypes::UPDATE;
case 'DELETE FROM':
return SyncJob::TYPE_DELETE;
return ActionTypes::DELETE;
default:
throw new \UnexpectedValueException("Unknown statement of type {$type}");
}
Expand Down
8 changes: 4 additions & 4 deletions Sync/DiffProvider/Item/DiffItemFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace ONGR\ConnectionsBundle\Sync\DiffProvider\Item;

use ONGR\ConnectionsBundle\Entity\SyncJob;
use ONGR\ConnectionsBundle\Sync\ActionTypes;

/**
* DiffItem factory.
Expand All @@ -29,11 +29,11 @@ class DiffItemFactory
public static function create($type)
{
switch ($type) {
case SyncJob::TYPE_CREATE:
case ActionTypes::CREATE:
return new CreateDiffItem();
case SyncJob::TYPE_UPDATE:
case ActionTypes::UPDATE:
return new UpdateDiffItem();
case SyncJob::TYPE_DELETE:
case ActionTypes::DELETE:
return new DeleteDiffItem();
default:
throw new \InvalidArgumentException("Invalid type {$type}");
Expand Down
Loading