Hello,
i got that following setup:
Page-Class width 2 $has_many relations, to: lets say "Customer"- and "CustomerPremium"- DataObjects.
My CustomerPremuim - Class is a direct Subclass of Customer.
Now i want an db-write - operation (update a Field) on each related CustomerPremium DataObject in that onAfterWrite() - Method on the Page-Class.
If i target the Parent-Class "Customer" with "$this->Customer()" the write() Method works, but not on the Subclass.
Even since the Subclass has its own $has_many relation in Page.
Any Idea why is that? :(
if i print out the result of the iteration i get my regular DataObjects in any case. So i'm wondering that i cant write to it just because
its an Subclass.
my code is:
class Page extends .... {
$has_many {
"Customers" => "Customer",
"CustomersPremium" => "CustomerPremium"
}
function onAfterWrite(){
foreach($this->CustomerPremium() as $i) {
$i->Format = "482 x 288";
$i->write();
}
parent::onAfterWrite();
.....
Thanks!