• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Add own code to XenForo_DataWriter::_postSave

xf_phantom

Well-known member
#1
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 ?
 

xf_phantom

Well-known member
#2
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:)