Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Do not alias EventFeatureEventsInterface
Browse files Browse the repository at this point in the history
- to prevent maintenance confusion later.
  • Loading branch information
weierophinney committed Sep 22, 2015
1 parent 959f1f9 commit 0523112
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/TableGateway/AbstractTableGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Zend\Db\Sql\TableIdentifier;
use Zend\Db\Sql\Update;
use Zend\Db\Sql\Where;
use Zend\Db\TableGateway\Feature\EventFeatureEventsInterface as EventFeature;
use Zend\Db\TableGateway\Feature\EventFeatureEventsInterface;

/**
*
Expand Down Expand Up @@ -95,7 +95,7 @@ public function initialize()
}

$this->featureSet->setTableGateway($this);
$this->featureSet->apply(EventFeature::EVENT_PRE_INITIALIZE, []);
$this->featureSet->apply(EventFeatureEventsInterface::EVENT_PRE_INITIALIZE, []);

if (!$this->adapter instanceof AdapterInterface) {
throw new Exception\RuntimeException('This table does not have an Adapter setup');
Expand All @@ -113,7 +113,7 @@ public function initialize()
$this->sql = new Sql($this->adapter, $this->table);
}

$this->featureSet->apply(EventFeature::EVENT_POST_INITIALIZE, []);
$this->featureSet->apply(EventFeatureEventsInterface::EVENT_POST_INITIALIZE, []);

$this->isInitialized = true;
}
Expand Down Expand Up @@ -231,7 +231,7 @@ protected function executeSelect(Select $select)
}

// apply preSelect features
$this->featureSet->apply(EventFeature::EVENT_PRE_SELECT, [$select]);
$this->featureSet->apply(EventFeatureEventsInterface::EVENT_PRE_SELECT, [$select]);

// prepare and execute
$statement = $this->sql->prepareStatementForSqlObject($select);
Expand All @@ -242,7 +242,7 @@ protected function executeSelect(Select $select)
$resultSet->initialize($result);

// apply postSelect features
$this->featureSet->apply(EventFeature::EVENT_POST_SELECT, [$statement, $result, $resultSet]);
$this->featureSet->apply(EventFeatureEventsInterface::EVENT_POST_SELECT, [$statement, $result, $resultSet]);

return $resultSet;
}
Expand Down Expand Up @@ -292,7 +292,7 @@ protected function executeInsert(Insert $insert)
}

// apply preInsert features
$this->featureSet->apply(EventFeature::EVENT_PRE_INSERT, [$insert]);
$this->featureSet->apply(EventFeatureEventsInterface::EVENT_PRE_INSERT, [$insert]);

// Most RDBMS solutions do not allow using table aliases in INSERTs
// See https://github.com/zendframework/zf2/issues/7311
Expand All @@ -308,7 +308,7 @@ protected function executeInsert(Insert $insert)
$this->lastInsertValue = $this->adapter->getDriver()->getConnection()->getLastGeneratedValue();

// apply postInsert features
$this->featureSet->apply(EventFeature::EVENT_POST_INSERT, [$statement, $result]);
$this->featureSet->apply(EventFeatureEventsInterface::EVENT_POST_INSERT, [$statement, $result]);

// Reset original table information in Insert instance, if necessary
if ($unaliasedTable) {
Expand Down Expand Up @@ -369,13 +369,13 @@ protected function executeUpdate(Update $update)
}

// apply preUpdate features
$this->featureSet->apply(EventFeature::EVENT_PRE_UPDATE, [$update]);
$this->featureSet->apply(EventFeatureEventsInterface::EVENT_PRE_UPDATE, [$update]);

$statement = $this->sql->prepareStatementForSqlObject($update);
$result = $statement->execute();

// apply postUpdate features
$this->featureSet->apply(EventFeature::EVENT_POST_UPDATE, [$statement, $result]);
$this->featureSet->apply(EventFeatureEventsInterface::EVENT_POST_UPDATE, [$statement, $result]);

return $result->getAffectedRows();
}
Expand Down Expand Up @@ -427,13 +427,13 @@ protected function executeDelete(Delete $delete)
}

// pre delete update
$this->featureSet->apply(EventFeature::EVENT_PRE_DELETE, [$delete]);
$this->featureSet->apply(EventFeatureEventsInterface::EVENT_PRE_DELETE, [$delete]);

$statement = $this->sql->prepareStatementForSqlObject($delete);
$result = $statement->execute();

// apply postDelete features
$this->featureSet->apply(EventFeature::EVENT_POST_DELETE, [$statement, $result]);
$this->featureSet->apply(EventFeatureEventsInterface::EVENT_POST_DELETE, [$statement, $result]);

return $result->getAffectedRows();
}
Expand Down

0 comments on commit 0523112

Please sign in to comment.