eZ Publish  [trunk]
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 ()
 Returns the definition for the object, the default implementation is to return an empty array.
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 18 of file ezvattype.php.


Member Function Documentation

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: public 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" ); }

Returns:
array

Reimplemented from eZPersistentObject.

Definition at line 25 of file ezvattype.php.

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

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

Definition at line 60 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 78 of file ezvattype.php.

Referenced by dynamicVatType().

Definition at line 20 of file ezvattype.php.

Referenced by create(), and dynamicVatType().

static eZVatType::fetch ( id,
asObject = true 
) [static]
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 162 of file ezvattype.php.

Referenced by findDependencies().

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 136 of file ezvattype.php.

Referenced by findDependencies().

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

Definition at line 109 of file ezvattype.php.

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

eZVatType::getPercentage ( object,
country 
)

Definition at line 46 of file ezvattype.php.

Definition at line 101 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 243 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 194 of file ezvattype.php.

Referenced by removeThis().

Definition at line 266 of file ezvattype.php.


Member Data Documentation

eZVatType::$VatTypeList

Definition at line 278 of file ezvattype.php.


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