removed evict cache policy from data updates
Change-Id: I24c153ed3598fae49bf7ce14224cb577d7d27e99
This commit is contained in:
parent
ff66fda4bc
commit
9a8d79ba1c
|
@ -58,28 +58,4 @@ abstract class EntityEventType implements IEntityEventType
|
|||
protected function getEM(){
|
||||
return Registry::getManager(self::EntityManager);
|
||||
}
|
||||
|
||||
protected function getLocalClassName(){
|
||||
$class_name = $this->entity_event->getEntityClassName();
|
||||
switch ($class_name){
|
||||
case 'MySchedule':
|
||||
case 'MyFavorite':
|
||||
return 'models\summit\SummitEvent';
|
||||
break;
|
||||
case 'PresentationType':
|
||||
return 'models\summit\SummitEventType';
|
||||
break;
|
||||
}
|
||||
return sprintf('models\summit\%s',$class_name);
|
||||
}
|
||||
|
||||
protected function evictEntity(){
|
||||
$cache = $this->getEM()->getCache();
|
||||
$class_name = $this->getLocalClassName();
|
||||
|
||||
if(!is_null($cache) && !empty($class_name) && $cache->containsEntity($class_name, $this->entity_event->getEntityId())) {
|
||||
$cache->evictEntity($class_name, $this->entity_event->getEntityId());
|
||||
Log::debug(sprintf("class_name % - id %s evicted from 2nd level cache", $class_name, $this->entity_event->getEntityId()));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,7 +24,6 @@ final class PresentationCategoryEntityEventType extends GenericSummitEntityEvent
|
|||
*/
|
||||
protected function registerEntity()
|
||||
{
|
||||
$this->evictEntity();
|
||||
$entity = $this->entity_event->getSummit()->getPresentationCategory($this->entity_event->getEntityId());
|
||||
if(is_null($entity)) return null;
|
||||
$this->entity_event->registerEntity($entity);
|
||||
|
|
|
@ -26,8 +26,7 @@ final class PresentationCategoryGroupEntityEventType extends GenericSummitEntity
|
|||
*/
|
||||
protected function registerEntity()
|
||||
{
|
||||
$this->evictEntity();
|
||||
$entity = $this->entity_event->getSummit()->getCategoryGroup($this->entity_event->getEntityId());
|
||||
$entity = $this->entity_event->getSummit()->getCategoryGroup($this->entity_event->getEntityId());
|
||||
if(is_null($entity)) return null;
|
||||
$this->entity_event->registerEntity($entity);
|
||||
return $entity;
|
||||
|
|
|
@ -29,7 +29,6 @@ final class PresentationMaterialEntityEventType extends GenericSummitEntityEvent
|
|||
if(!isset($metadata['presentation_id'])) return null;
|
||||
$presentation = $this->entity_event->getSummit()->getScheduleEvent(intval($metadata['presentation_id']));
|
||||
if (is_null($presentation)) return null;
|
||||
$this->evictEntity();
|
||||
$material = $presentation->getMaterial($this->entity_event->getEntityId());
|
||||
if(is_null($material)) return null;
|
||||
$this->entity_event->registerEntity($material);
|
||||
|
|
|
@ -26,7 +26,6 @@ final class PresentationSpeakerEntityEventType extends GenericSummitEntityEventT
|
|||
*/
|
||||
protected function registerEntity()
|
||||
{
|
||||
$this->evictEntity();
|
||||
$entity = $this->entity_event->getSummit()->getSpeaker($this->entity_event->getEntityId());
|
||||
if(!is_null($entity))
|
||||
$this->entity_event->registerEntity($entity);
|
||||
|
|
|
@ -26,7 +26,6 @@ final class SummitEntityEventType extends GenericSummitEntityEventType
|
|||
*/
|
||||
protected function registerEntity()
|
||||
{
|
||||
$this->evictEntity();
|
||||
$summit = $this->entity_event->getSummit();
|
||||
if(is_null($summit)) return null;
|
||||
if($summit->getId() !== $this->entity_event->getEntityId()) return null;
|
||||
|
|
|
@ -33,7 +33,6 @@ abstract class SummitEventEntityEventType extends EntityEventType
|
|||
* @return SummitEvent|null
|
||||
*/
|
||||
protected function getEntity(){
|
||||
$this->evictEntity();
|
||||
return $this->entity_event->getSummit()->getScheduleEvent($this->entity_event->getEntityId());
|
||||
}
|
||||
}
|
|
@ -25,7 +25,6 @@ final class SummitEventTypeEntityEventType extends GenericSummitEntityEventType
|
|||
*/
|
||||
protected function registerEntity()
|
||||
{
|
||||
$this->evictEntity();
|
||||
$entity = $this->entity_event->getSummit()->getEventType($this->entity_event->getEntityId());
|
||||
if(!is_null($entity))
|
||||
$this->entity_event->registerEntity($entity);
|
||||
|
|
|
@ -30,7 +30,6 @@ final class SummitLocationEntityEventType extends GenericSummitEntityEventType
|
|||
$type = $this->entity_event->getType();
|
||||
// if there is an insert in place, skip it
|
||||
if($type === 'UPDATE' && $this->process_ctx->existsInsertOp($this->entity_event)) return null;
|
||||
$this->evictEntity();
|
||||
$entity = $this->entity_event->getSummit()->getLocation($this->entity_event->getEntityId());
|
||||
if(is_null($entity)) return null;
|
||||
return $this->entity_event->registerEntity($entity);
|
||||
|
|
|
@ -29,7 +29,6 @@ final class SummitLocationImageEventType extends GenericSummitEntityEventType
|
|||
if(!isset($metadata['location_id'])) return null;
|
||||
$location = $this->entity_event->getSummit()->getLocation(intval($metadata['location_id']));
|
||||
if(is_null($location)) return null;
|
||||
$this->evictEntity();
|
||||
$entity = $location->getImage($this->entity_event->getEntityId());
|
||||
if(is_null($entity)) return null;
|
||||
$this->entity_event->registerEntity($entity);
|
||||
|
|
|
@ -25,7 +25,6 @@ final class SummitTicketTypeEntityEventType extends GenericSummitEntityEventType
|
|||
*/
|
||||
protected function registerEntity()
|
||||
{
|
||||
$this->evictEntity();
|
||||
$entity = $this->entity_event->getSummit()->getTicketType($this->entity_event->getEntityId());
|
||||
if(!is_null($entity))
|
||||
$this->entity_event->registerEntity($entity);
|
||||
|
|
|
@ -27,7 +27,6 @@ final class SummitVenueFloorEntityEventType extends GenericSummitEntityEventType
|
|||
{
|
||||
$metadata = $this->entity_event->getMetadata();
|
||||
if(!isset($metadata['venue_id'])) return null;
|
||||
$this->evictEntity();
|
||||
$location = $this->entity_event->getSummit()->getLocation(intval($metadata['venue_id']));
|
||||
if (is_null($location)) return null;
|
||||
$floor = $location->getFloor($this->entity_event->getEntityId());
|
||||
|
|
|
@ -26,7 +26,6 @@ class SummitWIFIConnectionEntityEventType extends GenericSummitEntityEventType
|
|||
*/
|
||||
protected function registerEntity()
|
||||
{
|
||||
$this->evictEntity();
|
||||
$entity = $this->entity_event->getSummit()->getWifiConnection($this->entity_event->getEntityId());
|
||||
if(!is_null($entity))
|
||||
$this->entity_event->registerEntity($entity);
|
||||
|
|
Loading…
Reference in New Issue