slug_generator = $slug_generator; } /** * @inheritdoc * @since 0.8 */ public function create(Name $name, Slug $slug) { do_action('aff_complex_product_factory_before_create'); do_action('aff_product_factory_before_create'); $complex_product = new Complex_Product($name, $slug); $complex_product = apply_filters('aff_complex_product_factory_create', $complex_product); $complex_product = apply_filters('aff_product_factory_create', $complex_product); do_action('aff_complex_product_factory_after_create', $complex_product); do_action('aff_product_factory_after_create', $complex_product); return $complex_product; } /** * @inheritdoc * @since 0.9.7 */ public function create_from_name(Name $name) { $complex_product = $this->create( $name, $this->slug_generator->generate_from_name($name) ); return $complex_product; } }