View more context

 

kinglozzer

~Sorry, Extensible::add_extension(DataObject::class, $anonymousClass)~ the first one is fine

Mo

Hmm, maybe I will just have to do that then

rista

yes @kinglozzer that is what I did, but I thought there is some, as you said, "API available"

rista

btw after executing query I'm returning it back to what it was, ANSI

kinglozzer

@Mo Anonymous classes seem to work, albeit not via add_extension(), just tested in a page controller:

  1. $page = $this->data();
  2. $page->extension_instances[] = new Class extends Extension {
  3. public function extensionTest() {
  4. die('hello');
  5. }
  6. };
  7. $page->extend('extensionTest');