set_value($value); } /** * Check if the type is simple. * * @since 0.7 * @return bool */ public function is_simple() { return $this->value === self::SIMPLE; } /** * Check if the type is complex. * * @since 0.7 * @return bool */ public function is_complex() { return $this->value === self::COMPLEX; } /** * Check if the type is complex. * * @since 0.7 * @return bool */ public function is_variant() { return $this->value === self::VARIANT; } /** * Get the translated label of the type. * * @since 0.9.2 * @return null|string The translated label if any. */ public function get_label() { switch($this->value) { case self::SIMPLE: $label = __('Simple', 'affilicious'); break; case self::VARIANT: $label = __('Variant', 'affilicious'); break; case self::COMPLEX: $label = __('Complex', 'affilicious'); break; default: $label = null; } $label = apply_filters('aff_product_type_label', $label, $this->value); return $label; } }