I want to put my Zend Model as Singleton, so I have done this:
class Social_Model_DbTable_Dossier extends Zend_Db_Table_Abstract {
private static $_instance;
public static function GetInstance() {
if (!self::$_instance instanceof self) {
self::$_instance = new self();
}
return self::$_instance;
}
private function __construct() {
// put normal constructor code.
// it will only ever be called once
}}
I instantiate my model like so:
$dossiercasModel = Social_Model_DbTable_Dossier::GetInstance();
but this erreur is occured:
Fatal error: Access level to Social_Model_DbTable_Dossier::__construct() must be public (as in class Zend_Db_Table_Abstract)
when I put the constructor of the Model as public it works fine but this is inconsistent with the notion of singleton!