Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Foo extends Nette\Object
- {
- /**
- * @Cache(expire=3600)
- * @Tags(foo, fuuu)
- * @return array
- */
- public function foo()
- {
- echo("getting ");
- return func_get_args();
- }
- /**
- * @Cache(expire=3600)
- * @Tags(bar, fuuu)
- * @return array
- */
- public function bar()
- {
- echo("getting ");
- return func_get_args();
- }
- /**
- * @return Foo
- */
- public function __call($method, $args)
- {
- return Kdyby\Tools\ModelTools::tryCall($this, $method, $args);
- }
- /**
- * @param array $conds
- */
- public static function cleanCache($conds)
- {
- Kdyby\Tools\ModelTools::cleanCache($conds);
- }
- }
- echo "<hr>";
- $f = new Foo();
- dump($f->foo(1), $f->foo(1));
- echo "<hr>";
- dump($f->c_foo(1), $f->c_foo(1));
- dump($f->c_bar('neco'), $f->c_bar('neco'));
- $f::cleanCache(array( 'tags' => array('bar') ));
- dump($f->c_bar('neco'), $f->c_bar('neco'));
- dump($f->c_foo('test', array('test1', 'test2')));
- dump($f->c_foo('test', array('test1', 'test2')));
Add Comment
Please, Sign In to add comment