/** * @param LifecycleEventArgs $args * @param bool $remove */ protected function update(LifecycleEventArgs $args, $remove) { $alias = $this->builder->getEntityAlias($args->getEntity()); $this->keeper->set($alias, new \DateTime()); if ($this->track_individually_entity) { $ids = $this->builder->getEntityIdentifier($args->getEntity()); if ($ids !== null) { if ($remove) { $this->keeper->remove($alias . $ids); } else { $this->keeper->set($alias . $ids, new \DateTime()); } } } }
public function testGetEntityAliasNoDoctrine() { $this->builder = new CacheKeyBuilder($this->etag_hasher); $this->assertNull($this->builder->getEntityAlias(new Foo())); }