Add own code to XenForo_DataWriter::_postSave

xf_phantom

Well-known member
I'm having some code, which i'd like to run inside most of the DataWriterts.
Instead of creating a proxy class for each dw, couldn't i add something to the XenForo_DataWriter ?
 
I thought that
PHP:
  static $baseExtended = false;
   public static function loadClassDatawriter($class, &$extend){


     if (!self::$baseExtended && in_array($class, self::getDataWritersForLog())){
       self::$baseExtended = true;
       $extend[] = 'Foo_Extend_XenForo_DataWriter';
     }
   }
wouldn't work, but it does:)
 
Back
Top Bottom