public function createCachedConditionGenerator($conditionGenerator, $ttl = null): ConditionGenerator
    {
        if (null === $this->cacheDriver) {
            return $conditionGenerator;
        }

        if ($conditionGenerator instanceof DqlConditionGenerator) {
            return new CachedDqlConditionGenerator($conditionGenerator, $this->cacheDriver, $ttl);
        } elseif ($conditionGenerator instanceof NativeQueryConditionGenerator) {
            return new CachedNativeQueryConditionGenerator($conditionGenerator, $this->cacheDriver, $ttl);
        }

        throw new \InvalidArgumentException(
            sprintf('ConditionGenerator "%s" is not supported by the DoctrineOrmFactory.', \get_class($conditionGenerator))
        );
    }
public function createCachedConditionGenerator($conditionGenerator, $ttl = null): ConditionGenerator
    {
        if (null === $this->cacheDriver) {
            return $conditionGenerator;
        }

        if ($conditionGenerator instanceof DqlConditionGenerator) {
            return new CachedDqlConditionGenerator($conditionGenerator, $this->cacheDriver, $ttl);
        } elseif ($conditionGenerator instanceof NativeQueryConditionGenerator) {
            return new CachedNativeQueryConditionGenerator($conditionGenerator, $this->cacheDriver, $ttl);
        }

        throw new \InvalidArgumentException(
            sprintf('ConditionGenerator "%s" is not supported by the DoctrineOrmFactory.', \get_class($conditionGenerator))
        );
    }
public function createCachedConditionGenerator ( $ conditionGenerator , $ ttl = null ) : ConditionGenerator { if ( null === $ this -> cacheDriver ) { return $ conditionGenerator ; } if ( $ conditionGenerator instanceof DqlConditionGenerator ) { return new CachedDqlConditionGenerator ( $ conditionGenerator , $ this -> cacheDriver , $ ttl ) ; } elseif ( $ conditionGenerator instanceof NativeQueryConditionGenerator ) { return new CachedNativeQueryConditionGenerator ( $ conditionGenerator , $ this -> cacheDriver , $ ttl ) ; } throw new \ InvalidArgumentException ( sprintf ( 'ConditionGenerator "%s" is not supported by the DoctrineOrmFactory.' , \ get_class ( $ conditionGenerator ) ) ) ; }
Creates a new CachedConditionGenerator instance for the ConditionGenerator.

@param DqlConditionGenerator|NativeQueryConditionGenerator $conditionGenerator
@param int|\DateInterval|null                              $ttl                Optional. The TTL value of this item. If no value is sent and
the driver supports TTL then the library may set a default value
for it or let the driver take care of that.
Creates a new CachedConditionGenerator instance for the ConditionGenerator .