eZ Publish  [4.2]
eZCountryType Class Reference

A content datatype that contains country. More...

+ Inheritance diagram for eZCountryType:
+ Collaboration diagram for eZCountryType:

List of all members.

Public Member Functions

 classAttributeContent ($classAttribute)
 diff ($old, $new, $options=false)
 eZCountryType ()
 fetchClassAttributeHTTPInput ($http, $base, $classAttribute)
 fetchCollectionAttributeHTTPInput ($collection, $collectionAttribute, $http, $base, $contentObjectAttribute)
 fetchObjectAttributeHTTPInput ($http, $base, $contentObjectAttribute)
 fromString ($contentObjectAttribute, $string)
 hasObjectAttributeContent ($contentObjectAttribute)
 initializeObjectAttribute ($contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
 insertSimpleString ($object, $objectVersion, $objectLanguage, $objectAttribute, $string, &$result)
 isIndexable ()
 isInformationCollector ()
 isSimpleStringInsertionSupported ()
 metaData ($contentObjectAttribute)
 objectAttributeContent ($contentObjectAttribute)
 preStoreClassAttribute ($classAttribute, $version)
 sortKey ($contentObjectAttribute)
 sortKeyType ()
 storeClassAttributeContent ($classAttribute, $content)
 storeObjectAttribute ($contentObjectAttribute)
 supportsBatchInitializeObjectAttribute ()
 title ($contentObjectAttribute, $name=null)
 toString ($contentObjectAttribute)
 validateCollectionAttributeHTTPInput ($http, $base, $contentObjectAttribute)
 validateObjectAttributeHTTPInput ($http, $base, $contentObjectAttribute)

Static Public Member Functions

static fetchCountry ($value, $fetchBy=false)
static fetchCountryList ()
static fetchTranslatedNames (&$countries)

Public Attributes

const DATA_TYPE_STRING = 'ezcountry'
const DEFAULT_LIST_FIELD = 'data_text5'
const MULTIPLE_CHOICE_FIELD = 'data_int1'

Static Protected Member Functions

static compareCountryNames ($a, $b)
 Sort callback used by fetchTranslatedNames to compare two country arrays.

Detailed Description

A content datatype that contains country.

The list of countries is fetched from contenet.ini. Country is stored as text string.

Definition at line 42 of file ezcountrytype.php.


Member Function Documentation

eZCountryType::classAttributeContent ( classAttribute)

Returns the content data for the given content class attribute.

Reimplemented from eZDataType.

Definition at line 351 of file ezcountrytype.php.

static eZCountryType::compareCountryNames ( a,
b 
) [static, protected]

Sort callback used by fetchTranslatedNames to compare two country arrays.

Parameters:
array$aCountry 1
array$bCountry 2
Returns:
bool

Definition at line 96 of file ezcountrytype.php.

eZCountryType::diff ( old,
new,
options = false 
)

Method used by content diff system to retrieve changes in attributes. This method implements the default behaviour, which is to show old and new version values of the object.

Reimplemented from eZDataType.

Definition at line 469 of file ezcountrytype.php.

eZCountryType::eZCountryType ( )

Definition at line 50 of file ezcountrytype.php.

eZCountryType::fetchClassAttributeHTTPInput ( http,
base,
classAttribute 
)

Fetches the HTTP input for the content class attribute.

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 129 of file ezcountrytype.php.

eZCountryType::fetchCollectionAttributeHTTPInput ( collection,
collectionAttribute,
http,
base,
contentObjectAttribute 
)

Fetches the http post variables for collected information

Reimplemented from eZDataType.

Definition at line 286 of file ezcountrytype.php.

static eZCountryType::fetchCountry ( value,
fetchBy = false 
) [static]

Fetches country by $fetchBy. if $fetchBy is false country name will be used.

Definition at line 105 of file ezcountrytype.php.

Referenced by classAttributeContent(), fetchClassAttributeHTTPInput(), fetchObjectAttributeHTTPInput(), and objectAttributeContent().

static eZCountryType::fetchCountryList ( ) [static]

Fetches country list from ini.

Definition at line 60 of file ezcountrytype.php.

Referenced by fetchCountry(), and fetchObjectAttributeHTTPInput().

eZCountryType::fetchObjectAttributeHTTPInput ( http,
base,
contentObjectAttribute 
)

Fetches the http post var and stores it in the data instance.

Reimplemented from eZDataType.

Definition at line 242 of file ezcountrytype.php.

static eZCountryType::fetchTranslatedNames ( &$  countries) [static]

Fetches translated country names from locale $countries will be updated.

Definition at line 76 of file ezcountrytype.php.

Referenced by fetchCountryList().

eZCountryType::fromString ( contentObjectAttribute,
string 
)

Reimplemented from eZDataType.

Definition at line 399 of file ezcountrytype.php.

eZCountryType::hasObjectAttributeContent ( contentObjectAttribute)
Returns:
true if the datatype finds any content in the attribute $contentObjectAttribute.

Reimplemented from eZDataType.

Definition at line 426 of file ezcountrytype.php.

eZCountryType::initializeObjectAttribute ( contentObjectAttribute,
currentVersion,
originalContentObjectAttribute 
)

Sets the default value.

Reimplemented from eZDataType.

Definition at line 189 of file ezcountrytype.php.

eZCountryType::insertSimpleString ( object,
objectVersion,
objectLanguage,
objectAttribute,
string,
&$  result 
)

Inserts the string $string to the content object attribute $objectAttribute.

Parameters:
$objectThe contentobject in which the attribute is contained
$objectVersionThe current version of the object it is being worked on
$objectLanguageThe current language being worked on
$objectAttributeThe attribute which will get the file
$filePathFull path including the filename
[out]$resultArray which will be filled with information on the process, it will contain:
  • errors - Array with error elements, each element is an array with 'description' containing the text
  • require_storage - true if the attribute must be stored after this call, or false if not required at all
Returns:
true if the file was stored correctly in the attribute or false if something failed.
Note:
The datatype will return null (the default) if does not support HTTP files.
$result will not be defined if the return value is null
See also:
isSimpleStringInsertionSupported()

Reimplemented from eZDataType.

Definition at line 317 of file ezcountrytype.php.

eZCountryType::isIndexable ( )
Returns:
true if the datatype can be indexed

Reimplemented from eZDataType.

Definition at line 433 of file ezcountrytype.php.

eZCountryType::isInformationCollector ( )
Returns:
true if the datatype can be used as an information collector

Reimplemented from eZDataType.

Definition at line 438 of file ezcountrytype.php.

eZCountryType::isSimpleStringInsertionSupported ( )

Simple string insertion is supported.

Reimplemented from eZDataType.

Definition at line 312 of file ezcountrytype.php.

eZCountryType::metaData ( contentObjectAttribute)

Returns the meta data used for storing search indeces.

Reimplemented from eZDataType.

Definition at line 372 of file ezcountrytype.php.

eZCountryType::objectAttributeContent ( contentObjectAttribute)

Returns the content.

Reimplemented from eZDataType.

Definition at line 331 of file ezcountrytype.php.

eZCountryType::preStoreClassAttribute ( classAttribute,
version 
)

Similar to the storeClassAttribute but is called before the attribute itself is stored and can be used to set values in the class attribute.

Returns:
True if the value was stored correctly.
See also:
fetchClassAttributeHTTPInput

Reimplemented from eZDataType.

Definition at line 166 of file ezcountrytype.php.

eZCountryType::sortKey ( objectAttribute)
Returns:
the sort key for the datatype. This is used for sorting on attribute level.

Reimplemented from eZDataType.

Definition at line 443 of file ezcountrytype.php.

eZCountryType::sortKeyType ( )
Returns:
the type of the sort key int|string False is returned if sorting is not supported

Reimplemented from eZDataType.

Definition at line 464 of file ezcountrytype.php.

eZCountryType::storeClassAttributeContent ( classAttribute,
content 
)

Definition at line 172 of file ezcountrytype.php.

Referenced by preStoreClassAttribute().

eZCountryType::storeObjectAttribute ( objectAttribute)

Stores the datatype data to the database which is related to the object attribute.

Returns:
True if the value was stored correctly.
Note:
The method is entirely up to the datatype, for instance it could reuse the available types in the the attribute or store in a separate object.
See also:
fetchObjectAttributeHTTPInput

Reimplemented from eZDataType.

Definition at line 299 of file ezcountrytype.php.

eZCountryType::supportsBatchInitializeObjectAttribute ( )

Reimplemented from eZDataType.

Definition at line 474 of file ezcountrytype.php.

eZCountryType::title ( contentObjectAttribute,
name = null 
)

Returns the country for use as a title

Reimplemented from eZDataType.

Definition at line 407 of file ezcountrytype.php.

eZCountryType::toString ( contentObjectAttribute)
Returns:
string representation of an contentobjectattribute data for simplified export

Reimplemented from eZDataType.

Definition at line 394 of file ezcountrytype.php.

eZCountryType::validateCollectionAttributeHTTPInput ( http,
base,
objectAttribute 
)

Validates the input for an object attribute and returns a validation state as defined in eZInputValidator.

Note:
Default implementation does nothing and returns accepted.

Reimplemented from eZDataType.

Definition at line 221 of file ezcountrytype.php.

eZCountryType::validateObjectAttributeHTTPInput ( http,
base,
objectAttribute 
)

Validates the input for an object attribute and returns a validation state as defined in eZInputValidator.

Note:
Default implementation does nothing and returns accepted.

Reimplemented from eZDataType.

Definition at line 203 of file ezcountrytype.php.


Member Data Documentation

const eZCountryType::DATA_TYPE_STRING = 'ezcountry'

Definition at line 44 of file ezcountrytype.php.

const eZCountryType::DEFAULT_LIST_FIELD = 'data_text5'

Definition at line 46 of file ezcountrytype.php.

Definition at line 48 of file ezcountrytype.php.


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