Answer the question
In order to leave comments, you need to log in
How to explicitly set the class of a variable?
Hello! When the array contains a list of objects and we loop through it, calling each object. Or when the entry looks like this:
$class = '\notification\\'.$row['mode'].'\\'.str_replace(" ", "", ucwords(str_replace("_", " ", $row['model']))) . 'Notification';
if (class_exists($class)){
$notifi = new $class($this);
$notifi->createObject($row);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question