Code in parent class:
foreach(static::$_aReadOnlyDatabaseTables AS $TableName => $aColumns){
}
This works when $ _aReadOnlyDatabaseTables is defined in the child class, but throws an error when $ _aReadOnlyDatabaseTables is missing. I need to check if this property exists first.
I think this should happen something like this:
if(property_exists(static,$_aReadOnlyDatabaseTables)){
foreach(static::$_aReadOnlyDatabaseTables AS $TableName => $aColumns){
}
}
But this causes a syntax error unexpected ',', expecting T_PAAMAYIM_NEKUDOTAYIM. Using $thisinstead staticdoes not work either; it always evaluates to false.
What is the correct syntax for this?
source
share