1. 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

Discussion in 'XenForo Development Discussions' started by xf_phantom, Jul 23, 2013.

  1. xf_phantom

    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 ?
     
  2. xf_phantom

    xf_phantom Well-Known Member

    I thought that
    PHP:
      static $baseExtended false;
       public static function 
    loadClassDatawriter($class, &$extend){


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

Share This Page