Hallo,
vllt. kann mir einer von Euch ja mal folgendes Verhalten erklären:
Ich habe eine Klasse (1), die ihrerseits eine andere Klasse
instanziiert (2). Nun möchte ich aus (1) heraus eine protected
Method der Klasse (2) aufrufen. Doch ich bekomme dann folgenden
Laufzeitfehler geschmissen
"Fatal error: Call to protected method SQLLib::markEntryAsRead()
from context 'ModulBrowser' [..]".
Warum dieser Fehler?
Nach eingetlicher OOP-Logik kann ich doch sehr wohl eine protected
Method von einer nicht ableitenden Klasse aufrufen.
Hier mal mein Code:
===ModulBrowser.class.php5 (1)===
public $SQLHandler; [..]
$this->SQLHandler = new SQLLib; [..]
$this->SQLHandler->markEntryAsRead($this->modul,$entryId,$usrId);
===SQLLib.class.php5 (2)===
/**
* @access protected
* Marks an Entry as read.
* @param String $modulName - Name of the Modul
* @param int $entryId - ID of the Entry
* @param int $usrid - ID of the User
* @return boolean - Success?
*/
protected function markEntryAsRead($modulName,$entryId,$usrId)
{
[...]
}
Danke für Antworten.
Patrik