-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathSize.php
64 lines (54 loc) · 1.43 KB
/
Size.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
declare( strict_types=1 );
namespace Automattic\WooCommerce\GoogleListingsAndAds\Product\Attributes;
use Automattic\WooCommerce\GoogleListingsAndAds\Admin\Product\Attributes\Input\SizeInput;
use Automattic\WooCommerce\GoogleListingsAndAds\Product\AttributeMapping\Traits\IsFieldTrait;
defined( 'ABSPATH' ) || exit;
/**
* Class Size
*
* @package Automattic\WooCommerce\GoogleListingsAndAds\Product\Attributes
*/
class Size extends AbstractAttribute implements WithMappingInterface {
use IsFieldTrait;
/**
* Returns the attribute ID.
*
* Must be the same as a Google product's property name to be set automatically.
*
* @return string
*
* @see \Google\Service\ShoppingContent\Product for the list of properties.
*/
public static function get_id(): string {
return 'size';
}
/**
* Return an array of WooCommerce product types that this attribute can be applied to.
*
* @return array
*/
public static function get_applicable_product_types(): array {
return [ 'simple', 'variation' ];
}
/**
* Return the attribute's input class. Must be an instance of `AttributeInputInterface`.
*
* @return string
*
* @see AttributeInputInterface
*
* @since 1.5.0
*/
public static function get_input_type(): string {
return SizeInput::class;
}
/**
* Returns the attribute name
*
* @return string
*/
public static function get_name(): string {
return __( 'Size', 'google-listings-and-ads' );
}
}