Bravo3\Orm\Services\Cache\EntityCachingInterface::exists PHP Method

exists() public method

Check if an entity exists in cache
public exists ( string $class_name, string $id ) : boolean
$class_name string
$id string
return boolean
    public function exists($class_name, $id);

Usage Example

コード例 #1
0
ファイル: CachingStrategyTest.php プロジェクト: bravo3/orm
 /**
  * @dataProvider getCacheServices
  * @param EntityCachingInterface $service
  */
 public function testStrategy(EntityCachingInterface $service)
 {
     $product = new Product();
     $product->setId(1234);
     $this->assertFalse($service->exists(Product::class, 1234));
     $service->store(Product::class, '1234', $product);
     $this->assertTrue($service->exists(Product::class, 1234));
     $r = $service->retrieve(Product::class, '1234');
     $service->purge(Product::class, '1234');
     $this->assertFalse($service->exists(Product::class, 1234));
     $this->assertEquals(1234, $r->getId());
 }
All Usage Examples Of Bravo3\Orm\Services\Cache\EntityCachingInterface::exists