Danke für deine Antwort

.
Das einzige was ich eigentlich will, ist, festzustellen ob eine Property in dem Object RightgroupPopo geändert hat.
Hab aber nicht herausgefunden ob PHP da eine Möglichkeit bieter und diese deshalb selbst implementiert.
Die Felder in der RightgroupPopo sind deshalb protected weil bei "public" die Magic-Method __set() nicht aufgerufen wird (logischerweise). Aber ich brauche einen Trigger der mir sagt: "Hey da hat eine Property geändert!".
Vielleicht gibt's da ja nen besseren Weg

.
EDIT: Okay folgendes hat mir geholfen:
http://mwop.net/blog/131-Overloading...s-in-PHP-5.2.0
Zudem habe ich meine abstract class dahingehend geändert, dass nun mit Reflection überprüft wird, ob die Property überhaupt existiert. Somit können nicht einfach neue Properties erzeugt werden

.
Neu sieht die Klasse so aus:
PHP-Code:
abstract class PHibernatePopo {
private $objectChanged;
private $reflection;
public function __construct() {
$this->objectChanged = null;
$this->reflection = new ReflectionObject($this);
}
public function __get($property) {
$prop = self::getProperty($property);
$prop->setAccessible( true );
return $prop->getValue($this);
}
public function __set($property,$value) {
$prop = self::getProperty($property);
$prop->setAccessible( true );
if($prop->getValue($this) !== $value)
$this->objectChanged = time();
$prop->setValue($this,$value);
}
public function resetChanged() {
$this->objectChanged = null;
}
public function hasChanged() {
if($this->objectChanged === null)
return false;
return true;
}
private function getProperty($property) {
if($this->reflection->hasProperty($property) === false)
throw new OutOfBoundsException('Property "' . $property . '" does not exists in class "' . get_class($this) . '"');
return $this->reflection->getProperty($property);
}
}
EDIT 2: Der Fehlermeldung verschwindet auch wenn man "public function __get()" in "public function
&__get()" ändert.