eZ Publish  [4.2]
eZVatType Class Reference

eZVatType handles different VAT types More...

+ Inheritance diagram for eZVatType:
+ Collaboration diagram for eZVatType:

List of all members.

Public Member Functions

 eZVatType ($row)
 getPercentage ($object, $country)
 isDynamic ()
 VATTypeList ()

Static Public Member Functions

static create ()
static definition ()
static dynamicVatType ($asObject=true)
static fetch ($id, $asObject=true)
static fetchDependentClassesCount ($vatID)
 Fetches number of product classes having given VAT type set as default.
static fetchDependentProductsCount ($vatID)
 Fetches number of products using given VAT type.
static fetchList ($asObject=true, $skipDynamic=false)
 removeThis ()
 Remove given VAT type and all references to it.

Public Attributes

 $VatTypeList

Static Private Member Functions

static dynamicVatTypeName ()
 Return name of the "fake" dynamic VAT type.
static resetToDefaultInProducts ($oldVAT)
 Change VAT type in all products from $oldVAT to the default VAT of a product class.

Detailed Description

eZVatType handles different VAT types

Definition at line 38 of file ezvattype.php.


Member Function Documentation

static eZVatType::create ( ) [static]

Definition at line 197 of file ezvattype.php.

static eZVatType::definition ( ) [static]
Returns:
the definition for the object, the default implementation is to return an empty array. It's upto each inheriting class to return a proper definition array.

The definition array is an associative array consists of these keys:

  • fields - an associative array of fields which defines which database field (the key) is to fetched and how they map to object member variables (the value).
  • keys - an array of fields which is used for uniquely identifying the object in the table.
  • function_attributes - an associative array of attributes which maps to member functions, used for fetching data with functions.
  • set_functions - an associative array of attributes which maps to member functions, used for setting data with functions.
  • increment_key - the field which is incremented on table inserts.
  • class_name - the classname which is used for instantiating new objecs when fetching from the database.
  • sort - an associative array which defines the default sorting of lists, the key is the table field while the value is the sorting method which is either asc or desc.
  • name - the name of the database table

Example:

static function definition()
{
    return array( "fields" => array( "id" => "ID",
                                     "version" => "Version",
                                     "name" => "Name" ),
                  "keys" => array( "id", "version" ),
                  "function_attributes" => array( "current" => "currentVersion",
                                                  "class_name" => "className" ),
                  "increment_key" => "id",
                  "class_name" => "eZContentClass",
                  "sort" => array( "id" => "asc" ),
                  "name" => "ezcontentclass" );
}

Reimplemented from eZPersistentObject.

Definition at line 45 of file ezvattype.php.

Referenced by fetch(), fetchList(), and removeThis().

static eZVatType::dynamicVatType ( asObject = true) [static]

Definition at line 80 of file ezvattype.php.

Referenced by fetch(), and fetchList().

static eZVatType::dynamicVatTypeName ( ) [static, private]

Return name of the "fake" dynamic VAT type.

Definition at line 98 of file ezvattype.php.

Referenced by dynamicVatType().

eZVatType::eZVatType ( row)

Definition at line 40 of file ezvattype.php.

Referenced by create(), and dynamicVatType().

static eZVatType::fetch ( id,
asObject = true 
) [static]

Definition at line 110 of file ezvattype.php.

Referenced by eZDefaultVATHandler\chooseVatType().

static eZVatType::fetchDependentClassesCount ( vatID) [static]

Fetches number of product classes having given VAT type set as default.

Returns:
Number of dependent product classes.

Definition at line 182 of file ezvattype.php.

static eZVatType::fetchDependentProductsCount ( vatID) [static]

Fetches number of products using given VAT type.

Parameters:
$vatIDid of VAT type to count dependent products for.
Returns:
Number of dependent products.

Definition at line 156 of file ezvattype.php.

static eZVatType::fetchList ( asObject = true,
skipDynamic = false 
) [static]
Parameters:
$skipDynamicif false, include dynamic VAT type to the list being returned.

Definition at line 129 of file ezvattype.php.

Referenced by eZPriceType\unserializeContentClassAttribute(), eZMultiPriceType\unserializeContentClassAttribute(), and VATTypeList().

eZVatType::getPercentage ( object,
country 
)

Definition at line 66 of file ezvattype.php.

eZVatType::isDynamic ( )

Definition at line 121 of file ezvattype.php.

eZVatType::removeThis ( ) [static]

Remove given VAT type and all references to it.

Drops VAT charging rules referencing the VAT type. Resets VAT type in associated products to its default value for a product class.

Parameters:
$vatIDid of VAT type to remove.

Definition at line 263 of file ezvattype.php.

static eZVatType::resetToDefaultInProducts ( oldVAT) [static, private]

Change VAT type in all products from $oldVAT to the default VAT of a product class.

Parameters:
$oldVATold VAT type id.
$newVATnew VAT type id.

Definition at line 214 of file ezvattype.php.

Referenced by removeThis().

eZVatType::VATTypeList ( )

Definition at line 286 of file ezvattype.php.


Member Data Documentation

eZVatType::$VatTypeList

Definition at line 298 of file ezvattype.php.


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