public static function remove_weight($weight) { self::$weights = array_diff(self::$weights, array($weight)); $class = "NewsWeight{$weight}"; if (ClassInfo::exists($class)) { Object::remove_extension('NewsHolder', $class); } }