4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Config\Resource;
15 * ResourceInterface is the interface that must be implemented by all Resource classes.
17 * @author Fabien Potencier <fabien@symfony.com>
19 interface ResourceInterface
22 * Returns a string representation of the Resource.
24 * This method is necessary to allow for resource de-duplication, for example by means
25 * of array_unique(). The string returned need not have a particular meaning, but has
26 * to be identical for different ResourceInterface instances referring to the same
27 * resource; and it should be unlikely to collide with that of other, unrelated
30 * @return string A string representation unique to the underlying Resource
32 public function __toString();
35 * Returns true if the resource has not been updated since the given timestamp.
37 * @param int $timestamp The last time the resource was loaded
39 * @return bool True if the resource has not been updated, false otherwise
41 * @deprecated since 2.8, to be removed in 3.0. If your resource can check itself for
42 * freshness implement the SelfCheckingResourceInterface instead.
44 public function isFresh($timestamp);
47 * Returns the tied resource.
49 * @return mixed The resource
51 * @deprecated since 2.8, to be removed in 3.0. As there are many different kinds of resource,
52 * a single getResource() method does not make sense at the interface level. You
53 * can still call getResource() on implementing classes, probably after performing
54 * a type check. If you know the concrete type of Resource at hand, the return value
55 * of this method may make sense to you.
57 public function getResource();