Excuse what is probably a really basic question but how do I achieve this.
$cache = New Mem;
$cache->event($event)->delete;
Which is called via the function below. Without the ->delete
, it works perfectly fine, but I just need to find a way to call the delete thus inside the function.
class Mem
{
function event($event)
{
global $pdo;
global $memcached;
$key = md5(sha1($event) . sha1('events'));
if ($this->delete)
{
return $memcached->delete($key);
}
else
{
return $memcached->get($key);
}
}
}
I hope that makes sense, sorry for my pseudo code basically for the delete part.