PreviousProductDataField.php
3 years ago
PreviousProductIDDataField.php
3 years ago
PreviousProductNameField.php
3 years ago
ProductDataField.php
3 years ago
ProductIDDataField.php
2 years ago
ProductNameDataField.php
2 years ago
ProductIDDataField.php
95 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCart\Integrations\ThriveAutomator\DataFields; |
| 4 | |
| 5 | if ( ! defined( 'ABSPATH' ) ) { |
| 6 | exit; // Silence is golden! |
| 7 | } |
| 8 | |
| 9 | use SureCart\Integrations\ThriveAutomator\DataObjects\ProductDataObject; |
| 10 | use Thrive\Automator\Items\Data_Field; |
| 11 | |
| 12 | /** Product name field. */ |
| 13 | class ProductIDDataField extends Data_Field { |
| 14 | /** |
| 15 | * The id for the data field. |
| 16 | * |
| 17 | * @return string |
| 18 | */ |
| 19 | public static function get_id() { |
| 20 | return 'surecart_product_id_data_field'; |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * The name for the data field. |
| 25 | * |
| 26 | * @return string |
| 27 | */ |
| 28 | public static function get_name() { |
| 29 | return __( 'Product ID', 'surecart' ); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * The description for the data field. |
| 34 | * |
| 35 | * @return string |
| 36 | */ |
| 37 | public static function get_description() { |
| 38 | return __( 'A specific product id.', 'surecart' ); |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * The placeholder for the data field. |
| 43 | * |
| 44 | * @return string |
| 45 | */ |
| 46 | public static function get_placeholder() { |
| 47 | return __( 'Product ID', 'surecart' ); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * The supported filters for the data field. |
| 52 | * |
| 53 | * @return array |
| 54 | */ |
| 55 | public static function get_supported_filters() { |
| 56 | return [ 'string_ec' ]; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * The validators for the data field. |
| 61 | * |
| 62 | * @return array |
| 63 | */ |
| 64 | public static function get_validators() { |
| 65 | return [ 'required' ]; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * The value type for the data field. |
| 70 | * |
| 71 | * @return string |
| 72 | */ |
| 73 | public static function get_field_value_type() { |
| 74 | return static::TYPE_STRING; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * The dummy value for the data field. |
| 79 | * |
| 80 | * @return string |
| 81 | */ |
| 82 | public static function get_dummy_value() { |
| 83 | return __( 'Product ID', 'surecart' ); |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * The primary key for the data field. |
| 88 | * |
| 89 | * @return string |
| 90 | */ |
| 91 | public static function primary_key() { |
| 92 | return ProductDataObject::get_id(); |
| 93 | } |
| 94 | } |
| 95 |