2010-07-04 16:31:01 +01:00
|
|
|
<?php
|
|
|
|
|
2010-10-02 11:42:31 +01:00
|
|
|
/*
|
2011-01-15 13:29:43 +00:00
|
|
|
* This file is part of the Symfony package.
|
2010-10-02 11:42:31 +01:00
|
|
|
*
|
2011-03-06 11:40:06 +00:00
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
2010-10-02 11:42:31 +01:00
|
|
|
*
|
2011-01-15 13:29:43 +00:00
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
2010-10-02 11:42:31 +01:00
|
|
|
*/
|
|
|
|
|
2011-01-15 13:29:43 +00:00
|
|
|
namespace Symfony\Component\Validator\Mapping\Cache;
|
|
|
|
|
2010-08-20 22:09:55 +01:00
|
|
|
use Symfony\Component\Validator\Mapping\ClassMetadata;
|
2010-07-04 16:31:01 +01:00
|
|
|
|
|
|
|
/**
|
2014-12-21 17:00:50 +00:00
|
|
|
* Persists ClassMetadata instances in a cache.
|
2010-07-04 16:31:01 +01:00
|
|
|
*
|
2012-05-26 08:48:33 +01:00
|
|
|
* @author Bernhard Schussek <bschussek@gmail.com>
|
2010-07-04 16:31:01 +01:00
|
|
|
*/
|
|
|
|
interface CacheInterface
|
|
|
|
{
|
|
|
|
/**
|
2014-12-21 17:00:50 +00:00
|
|
|
* Returns whether metadata for the given class exists in the cache.
|
2010-07-04 16:31:01 +01:00
|
|
|
*
|
|
|
|
* @param string $class
|
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function has($class);
|
2010-07-04 16:31:01 +01:00
|
|
|
|
|
|
|
/**
|
2014-12-21 17:00:50 +00:00
|
|
|
* Returns the metadata for the given class from the cache.
|
2010-07-04 16:31:01 +01:00
|
|
|
*
|
2010-10-15 22:49:09 +01:00
|
|
|
* @param string $class Class Name
|
|
|
|
*
|
2012-03-12 18:44:07 +00:00
|
|
|
* @return ClassMetadata|false A ClassMetadata instance or false on miss
|
2010-07-04 16:31:01 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function read($class);
|
2010-07-04 16:31:01 +01:00
|
|
|
|
|
|
|
/**
|
2014-12-21 17:00:50 +00:00
|
|
|
* Stores a class metadata in the cache.
|
2010-07-04 16:31:01 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function write(ClassMetadata $metadata);
|
2011-06-08 11:16:48 +01:00
|
|
|
}
|