Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
TaxSetup Class Reference

Public Member Functions

 __construct (ModuleDataSetupInterface $setup, SalesSetupFactory $salesSetupFactory, ConfigInterface $productTypeConfig)
 
 getTaxableItems ()
 
 addAttribute ($entityTypeId, $code, array $attr)
 
 updateAttribute ($entityTypeId, $id, $field, $value=null, $sortOrder=null)
 

Protected Attributes

 $salesSetup
 
 $productTypeConfig
 

Detailed Description

Tax Setup Resource Model

Definition at line 15 of file TaxSetup.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ModuleDataSetupInterface  $setup,
SalesSetupFactory  $salesSetupFactory,
ConfigInterface  $productTypeConfig 
)

Init

Parameters
ModuleDataSetupInterface$setup
SalesSetupFactory$salesSetupFactory
ConfigInterface$productTypeConfig

Definition at line 36 of file TaxSetup.php.

40  {
41  $this->salesSetup = $salesSetupFactory->create(['resourceName' => 'tax_setup', 'setup' => $setup]);
42  $this->productTypeConfig = $productTypeConfig;
43  }
$setup
Definition: trigger.php:12

Member Function Documentation

◆ addAttribute()

addAttribute (   $entityTypeId,
  $code,
array  $attr 
)

Add entity attribute.

Parameters
int | string$entityTypeId
string$code
array$attr
Returns
$this

Definition at line 63 of file TaxSetup.php.

64  {
65  //Delegate
66  return $this->salesSetup->addAttribute($entityTypeId, $code, $attr);
67  }
$attr
Definition: text.phtml:8
$code
Definition: info.phtml:12

◆ getTaxableItems()

getTaxableItems ( )

Get taxable product types

Returns
array

Definition at line 50 of file TaxSetup.php.

51  {
52  return $this->productTypeConfig->filter('taxable');
53  }

◆ updateAttribute()

updateAttribute (   $entityTypeId,
  $id,
  $field,
  $value = null,
  $sortOrder = null 
)

Update Attribute data and Attribute additional data.

Parameters
int | string$entityTypeId
int | string$id
string$field
mixed$value
int$sortOrder
Returns
$this

Definition at line 79 of file TaxSetup.php.

80  {
81  //Delegate
82  return $this->salesSetup->updateAttribute($entityTypeId, $id, $field, $value, $sortOrder);
83  }
$id
Definition: fieldset.phtml:14
$value
Definition: gender.phtml:16

Field Documentation

◆ $productTypeConfig

$productTypeConfig
protected

Definition at line 27 of file TaxSetup.php.

◆ $salesSetup

$salesSetup
protected

Definition at line 20 of file TaxSetup.php.


The documentation for this class was generated from the following file: