slug_generator = $slug_generator; } /** * @inheritdoc * @since 0.8 */ public function create(Name $name, Slug $slug, Type $type, Unit $unit = null) { do_action('aff_attribute_template_factory_before_create'); $attribute_template = new Attribute_Template($name, $slug, $type, $unit); $attribute_template = apply_filters('aff_attribute_template_factory_create', $attribute_template); do_action('aff_attribute_template_factory_after_create', $attribute_template); return $attribute_template; } /** * @inheritdoc * @since 0.8 */ public function create_from_name(Name $name, Type $type, Unit $unit = null) { $attribute_template = $this->create( $name, $this->slug_generator->generate_from_name($name), $type, $unit ); return $attribute_template; } /** * @inheritdoc * @since 0.9 */ public function create_from_attribute(Attribute $attribute) { $attribute_template = $this->create( $attribute->get_name(), $attribute->get_slug(), $attribute->get_type(), $attribute->get_unit() ); return $attribute_template; } }