Skip to content

Commit

Permalink
Optimize standard column check
Browse files Browse the repository at this point in the history
  • Loading branch information
codeliner committed Jan 11, 2015
1 parent 806d84b commit d7462f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/DoctrineEventStoreAdapter.php
Expand Up @@ -40,6 +40,11 @@ class DoctrineEventStoreAdapter implements AdapterInterface, TransactionFeatureI
*/
protected $serializerAdapter;

/**
* @var array
*/
protected $standardColumns = ['eventId', 'eventName', 'occurredOn', 'payload', 'version'];

/**
* @param array $configuration
* @throws \Prooph\EventStore\Adapter\Exception\ConfigurationException
Expand Down Expand Up @@ -160,7 +165,7 @@ public function loadEventsByMetadataFrom(StreamName $aStreamName, array $metadat

//Add metadata stored in table
foreach ($eventData as $key => $value) {
if (! in_array($key, ['eventId', 'eventName', 'occurredOn', 'payload', 'version'])) {
if (! in_array($key, $this->standardColumns)) {
$metadata[$key] = $value;
}
}
Expand Down

0 comments on commit d7462f3

Please sign in to comment.