Skip to content

Latest commit

 

History

History
1355 lines (686 loc) · 29.4 KB

class.TaxCore.md

File metadata and controls

1355 lines (686 loc) · 29.4 KB

Class TaxCore

Contents

Properties

Methods

Properties

$_product_country_tax

protected mixed $_product_country_tax = array()

$_product_tax_via_rules

protected mixed $_product_tax_via_rules = array()

$account_number

public string $account_number

$active

public boolean $active

$deleted

public boolean $deleted

$fieldsRequired

protected mixed $fieldsRequired = array('rate')

$fieldsRequiredLang

protected mixed $fieldsRequiredLang = array('name')

$fieldsSizeLang

protected mixed $fieldsSizeLang = array('name' => 32)

$fieldsValidate

protected mixed $fieldsValidate = array('rate' => 'isFloat')

$fieldsValidateLang

protected mixed $fieldsValidateLang = array('name' => 'isGenericName')

$identifier

protected mixed $identifier = 'id_tax'

$name

public string $name

$rate

public float $rate

$table

protected mixed $table = 'tax'

$webserviceParameters

protected mixed $webserviceParameters = array('objectsNodeName' => 'taxes')

$_cache

protected mixed $_cache = array()

$fieldsRequiredDatabase

protected \fieldsRequiredDatabase $fieldsRequiredDatabase = null

$fieldsSize

protected array $fieldsSize = array()

$id

public integer $id

$id_lang

protected integer $id_lang = null

$id_shop

protected mixed $id_shop = null

$image_dir

protected string $image_dir = null

$image_format

protected string $image_format = 'jpg'

$langMultiShop

protected mixed $langMultiShop = false

$tables

protected array $tables = array()

Methods

__construct

mixed ObjectModelCore::__construct(integer $id, integer $id_lang, $id_shop)

Build object

Arguments

  • $id integer - Existing object id in order to load object (optional)
  • $id_lang integer - Required if object is multilingual (optional)
  • $id_shop mixed

_onStatusChange

mixed TaxCore::_onStatusChange()

add

mixed ObjectModelCore::add($autodate, $nullValues)

Add current object to database

return boolean Insertion result

Arguments

  • $autodate mixed
  • $nullValues mixed

addFieldsRequiredDatabase

mixed ObjectModelCore::addFieldsRequiredDatabase($fields)

Arguments

  • $fields mixed

associateTo

boolean ObjectModelCore::associateTo(integer|array $id_shops, string $type)

This function associate an item to its context

Arguments

  • $id_shops integer|array
  • $type string

clearCache

mixed ObjectModelCore::clearCache($all)

Arguments

  • $all mixed

delete

mixed TaxCore::delete()

deleteImage

boolean ObjectModelCore::deleteImage()

Delete images associated with the object

deleteSelection

mixed ObjectModelCore::deleteSelection($selection)

Delete several objects from database

return boolean Deletion result

Arguments

  • $selection mixed

displayFieldName

mixed ObjectModelCore::displayFieldName($field, $className, $htmlentities, \Context $context)

Arguments

  • $field mixed
  • $className mixed
  • $htmlentities mixed
  • $context Context

duplicateShops

mixed ObjectModelCore::duplicateShops($id)

Arguments

  • $id mixed

excludeTaxeOption

mixed TaxCore::excludeTaxeOption()

existsInDatabase

boolean ObjectModelCore::existsInDatabase($id_entity, $table)

Specify if an ObjectModel is already in database

Arguments

  • $id_entity mixed - entity id
  • $table mixed

getAccountNumberByIdTax

string TaxCore::getAccountNumberByIdTax(integer $id_tax)

Returns the Account number of a Tax

Arguments

  • $id_tax integer

getCarrierTaxRate

float TaxCore::getCarrierTaxRate($id_carrier, $id_address)

Returns the carrier tax rate

Arguments

  • $id_carrier mixed
  • $id_address mixed

getFields

mixed TaxCore::getFields()

getFieldsRequiredDatabase

mixed ObjectModelCore::getFieldsRequiredDatabase($all)

Arguments

  • $all mixed

getFieldsValidateLang

array ObjectModelCore::getFieldsValidateLang()

Get list of fields related to language to validate

getIdentifier

string ObjectModelCore::getIdentifier()

Get object identifier name

getProductEcotaxRate

float TaxCore::getProductEcotaxRate($id_address)

Returns the ecotax tax rate

Arguments

  • $id_address mixed

getProductTaxRate

\Tax TaxCore::getProductTaxRate(integer $id_product, $id_address)

Returns the product tax

Arguments

  • $id_product integer
  • $id_address mixed

getProductTaxRateViaRules

\Tax TaxCore::getProductTaxRateViaRules(integer $id_product, integer $id_country, $id_state, $zipcode)

Return the product tax rate using the tax rules system

Arguments

  • $id_product integer
  • $id_country integer
  • $id_state mixed
  • $zipcode mixed

getTaxIdByName

mixed TaxCore::getTaxIdByName(string $tax_name, boolean $active)

Return the tax id associated to the specified name

Arguments

  • $tax_name string
  • $active boolean - (true by default)

getTaxes

array TaxCore::getTaxes($id_lang, $active_only)

Get all available taxes

Arguments

  • $id_lang mixed
  • $active_only mixed

getTranslationsFields

mixed ObjectModelCore::getTranslationsFields(array $fieldsArray)

Prepare multilingual fields for database insertion

Arguments

  • $fieldsArray array - Multilingual fields to prepare return array Prepared fields for database insertion

getTranslationsFieldsChild

array TaxCore::getTranslationsFieldsChild()

Check then return multilingual fields for database interaction

getValidationRules

array ObjectModelCore::getValidationRules(string $className)

Returns object validation rules (fields validity)

Arguments

  • $className string - Child class name for static use (optional)

getWebserviceObjectList

mixed ObjectModelCore::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)

Arguments

  • $sql_join mixed
  • $sql_filter mixed
  • $sql_sort mixed
  • $sql_limit mixed

getWebserviceParameters

mixed ObjectModelCore::getWebserviceParameters($wsParamsAttributeName)

Arguments

  • $wsParamsAttributeName mixed

historize

mixed TaxCore::historize()

Save the object with the field deleted to true

@return bool

hydrate

mixed ObjectModelCore::hydrate(array $data, integer $id_lang)

Fill an object with given data. Data must be an array with this syntax: array(objProperty => value, objProperty2 => value, etc.)

Arguments

  • $data array
  • $id_lang integer

hydrateCollection

array ObjectModelCore::hydrateCollection(string $class, array $datas, integer $id_lang)

Fill (hydrate) a list of objects in order to get a collection of these objects

Arguments

  • $class string - Class of objects to hydrate
  • $datas array - List of data (multi-dimensional array)
  • $id_lang integer

isAssociatedToGroupShop

boolean ObjectModelCore::isAssociatedToGroupShop(integer $id_group_shop)

Check if current object is associated to a group shop

Arguments

  • $id_group_shop integer

isAssociatedToShop

boolean ObjectModelCore::isAssociatedToShop(integer $id_shop)

Check if current object is associated to a shop

Arguments

  • $id_shop integer

isCurrentlyUsed

boolean ObjectModelCore::isCurrentlyUsed(string $table, boolean $has_active_column)

This method is allow to know if a entity is currently used

Arguments

  • $table string - name of table linked to entity
  • $has_active_column boolean - true if the table has an active column

isLangMultishop

mixed ObjectModelCore::isLangMultishop()

isUsed

boolean TaxCore::isUsed()

Returns true if the tax is used in an order details

makeTranslationFields

mixed ObjectModelCore::makeTranslationFields($fields, $fieldsArray, $id_language)

Arguments

  • $fields mixed
  • $fieldsArray mixed
  • $id_language mixed

save

mixed ObjectModelCore::save($nullValues, $autodate)

Save current object to database (add or update)

return boolean Insertion result

Arguments

  • $nullValues mixed
  • $autodate mixed

toggleStatus

mixed TaxCore::toggleStatus()

update

mixed TaxCore::update($nullValues)

Arguments

  • $nullValues mixed

validateControler

mixed ObjectModelCore::validateControler($htmlentities)

TODO: refactor rename all calls to this to validateController

Arguments

  • $htmlentities mixed

validateController

mixed ObjectModelCore::validateController($htmlentities)

Arguments

  • $htmlentities mixed

validateFields

mixed ObjectModelCore::validateFields($die, $errorReturn)

Check for fields validity before database interaction

Arguments

  • $die mixed
  • $errorReturn mixed

validateFieldsLang

mixed ObjectModelCore::validateFieldsLang($die, $errorReturn)

Check for multilingual fields validity before database interaction

Arguments

  • $die mixed
  • $errorReturn mixed