Gabe wrote:
I'm trying to use the following method of a class (DbConnector):

public function closeConnector() {
     //
     echo "<p>in closeConnector()";
     var_dump(DbConnector::$connector);
     echo "</p>";
//make sure the db object is cleaned up properly
     if ( gettype(DbConnector::$connector) == 'object' ) {
      echo "<br><br>close the ADOdb connection<br><br>";
      DbConnector::$connector->Close();
}

     //put things back the way they were found
     $this->connector = false;
   }

DbConnector is meant to be a singleton class that manages an ADOdb object. However, when the code executes and it gets to this line:

DbConnector::$connector->Close();

the script fails and says "Call to undefined method DbConnector::Close()" Is trying to call the Close() method of the static member var (which holds an ADOdb object) not possible?

I think I thought of a better way to ask my question.  :)

Is it possible for a static member to hold an object? If so, is it possible for me to access the members and methods of that object like so: myClass::myStaticVarHoldingTheObject->methodOfTheObject

I'm trying to access methods of an object that is stored in a static variable using that line of code. It keeps spitting out an error that says "myClass" does not have a defined method "methodOfTheObject".

I hope that's clearer.  Sorry about any confusion...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to