PHP object question -


Sorry, maybe there is really a basic question but how do I get it?

  $ cache = new meme; $ Cache- & gt; Event ($ event) - & gt; remove;  

Below is called through the function. - & gt; Without deletion , it works perfectly, but I need to find a way to call this way to delete the function.

  class mem {function event ($ event) {global $ pdo; Global $ memcatch; $ Key = MD5 (sha 1 ($ event). Sha1 ('event')); If ($ -> this- & gt; delete) {return $ memcached-> Delete ($ key); } And {refund $ memcached-> Get ($ key); }}}  

I hope that the original removal code for my pseudo code is understandable.

You are calling delete as if it was in your class There was a method - but you have no method but instead of delete ... instead, you should evaluate the $ event variable as I am doing down and deciding it What action will you take:

  class mem {private $ pdo; Private $ memcatch; Public Function Event ($ Event) {$ key = md5 (sha1 ($ event). Sha1 ('events')); # From your original code switch ($ Event) {Case "Delete": #do Removing Content $ - this-> Memchached-> Delete ($ key); break; Case "Add": #do Breaking the Goods; }}}  

Update: after additional questions in comments ...

  class events {private $ key; Public function __ conversion ($ key) {$ this- & gt; Key = $ key; } Delete public function ($ key) {# do delete}}  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -