/**
  * {@inheritdoc}
  */
 public function exists($entity, array $extraConditions = array())
 {
     if (empty($extraConditions)) {
         $key = new EntityCacheKey($this->class->rootEntityName, $this->class->getIdentifierValues($entity));
         if ($this->region->contains($key)) {
             return true;
         }
     }
     return $this->persister->exists($entity, $extraConditions);
 }
 /**
  * {@inheritdoc}
  */
 public function exists($entity, Criteria $extraConditions = null)
 {
     if (null === $extraConditions) {
         $key = new EntityCacheKey($this->class->rootEntityName, $this->class->getIdentifierValues($entity));
         if ($this->region->contains($key)) {
             return true;
         }
     }
     return $this->persister->exists($entity, $extraConditions);
 }