Informationsystem_Item_Import_Csv_Controller
extends Core_Servant_Properties
in package
Information systems import CSV controller
Tags
Table of Contents
Properties
- $_aAdditionalGroups : array<string|int, mixed>
- List of additional group
- $_aClearedPropertyValues : array<string|int, mixed>
- Array of property values
- $_aConfig : array<string|int, mixed>
- CSV config
- $_aExternalProperties : array<string|int, mixed>
- List of external properties
- $_aExternalPropertiesDesc : array<string|int, mixed>
- List of descriptions of external properties
- $_aExternalPropertiesSmall : array<string|int, mixed>
- List of small parts of external properties
- $_aInsertedGroupIDs : array<string|int, mixed>
- Array of inserted groups
- $_aInsertedItemIDs : array<string|int, mixed>
- Array of inserted items
- $_allowedProperties : array<string|int, mixed>
- Allowed object properties
- $_aTags : mixed
- Array of cached tags
- $_aUpdatedGroupIDs : array<string|int, mixed>
- Array of updated groups
- $_aUpdatedItemIDs : array<string|int, mixed>
- Array of updated items
- $_iCurrentGroupId : int
- ID of current group
- $_iCurrentInformationsystemId : int
- ID of current informationsystem
- $_InsertedGroupsCount : int
- Count of inserted groups
- $_InsertedItemsCount : int
- Count of inserted items
- $_oCurrentGroup : Informationsystem_Group_Model
- Current group
- $_oCurrentInformationsystem : Informationsystem_Model
- Current informationsystem
- $_oCurrentItem : Informationsystem_Item_Model
- Current item
- $_propertiesValues : array<string|int, mixed>
- Properties values
- $_sBigImageFile : string
- Path of the big image
- $_sCurrentTags : string
- Current tags
- $_sSmallImageFile : string
- Path of the small image
- $_unlimitedProperties : bool
- Object has unlimited number of properties
- $_UpdatedGroupsCount : int
- Count of updated groups
- $_UpdatedItemsCount : int
- Count of updated items
Methods
- __construct() : mixed
- Constructor.
- __sleep() : array<string|int, mixed>
- Execute some routine before serialization
- __toString() : string
- Convert object to string
- __wakeup() : self
- Reestablish any database connections that may have been lost during serialization and perform other reinitialization tasks
- addAllowedProperties() : self
- Add additional allowed properties
- addAllowedProperty() : self
- Add additional allowed property
- clear() : self
- Clear object
- CorrectToEncoding() : array<string|int, mixed>
- Correct CSV-line encoding
- getCSVLine() : array<string|int, mixed>
- Get CSV line from file
- getInsertedGroupsCount() : int
- Get inserted groups count
- getInsertedItemsCount() : int
- Get inserted items count
- getUpdatedGroupsCount() : int
- Get updated groups count
- getUpdatedItemsCount() : int
- Get updated items count
- import() : mixed
- Импорт CSV
- set() : self
- Run when writing data to inaccessible properties
- setCurrentItem() : self
- Set $this->_oCurrentItem
- setUnlimitedProperties() : self
- Set unlimitedProperties
- _convertToPunycode() : string
- Convert url to Punycode
- _doSaveGroup() : Informationsystem_Group
- Save group
- _downloadHttpFile() : path
- Download file to the TMP dir
- _getTags() : array<string|int, mixed>
- Get cached tags of array
- _incInsertedGroups() : self
- Increment inserted groups
- _incInsertedItems() : self
- Increment inserted items
- _incUpdatedGroups() : self
- Increment updated groups
- _incUpdatedItems() : self
- Increment updated items
- init() : self
- Initialization
Properties
$_aAdditionalGroups
List of additional group
protected
array<string|int, mixed>
$_aAdditionalGroups
= array()
$_aClearedPropertyValues
Array of property values
protected
array<string|int, mixed>
$_aClearedPropertyValues
= array()
$_aConfig
CSV config
protected
array<string|int, mixed>
$_aConfig
= \NULL
$_aExternalProperties
List of external properties
protected
array<string|int, mixed>
$_aExternalProperties
= array()
$_aExternalPropertiesDesc
List of descriptions of external properties
protected
array<string|int, mixed>
$_aExternalPropertiesDesc
= array()
$_aExternalPropertiesSmall
List of small parts of external properties
protected
array<string|int, mixed>
$_aExternalPropertiesSmall
= array()
$_aInsertedGroupIDs
Array of inserted groups
protected
array<string|int, mixed>
$_aInsertedGroupIDs
= array()
$_aInsertedItemIDs
Array of inserted items
protected
array<string|int, mixed>
$_aInsertedItemIDs
= array()
$_allowedProperties
Allowed object properties
protected
array<string|int, mixed>
$_allowedProperties
= array(
// Кодировка импорта
'encoding',
// Файл импорта
'file',
// Позиция в файле импорта
'seek',
// Ограничение импорта по времени
'time',
// Ограничение импорта по количеству
'step',
// Настройка CSV: разделитель
'separator',
// Настройка CSV: ограничитель
'limiter',
// Настройка CSV: первая строка - название полей
'firstlineheader',
// Настройка CSV: массив соответствий полей CSV сущностям системы HostCMS
'csv_fields',
// Путь к картинкам
'imagesPath',
// Действие с существующими информационными элементами:
// 1 - обновить существующие информационные элементы
// 2 - не обновлять существующие информационные элементы
// 3 - удалить содержимое информационной системы до импорта
'importAction',
// Флаг, указывающий, включена ли индексация
'searchIndexation',
'deleteImage',
)
$_aTags
Array of cached tags
protected
mixed
$_aTags
= \NULL
$_aUpdatedGroupIDs
Array of updated groups
protected
array<string|int, mixed>
$_aUpdatedGroupIDs
= array()
$_aUpdatedItemIDs
Array of updated items
protected
array<string|int, mixed>
$_aUpdatedItemIDs
= array()
$_iCurrentGroupId
ID of current group
protected
int
$_iCurrentGroupId
= 0
$_iCurrentInformationsystemId
ID of current informationsystem
protected
int
$_iCurrentInformationsystemId
= 0
$_InsertedGroupsCount
Count of inserted groups
protected
int
$_InsertedGroupsCount
$_InsertedItemsCount
Count of inserted items
protected
int
$_InsertedItemsCount
$_oCurrentGroup
Current group
protected
Informationsystem_Group_Model
$_oCurrentGroup
$_oCurrentInformationsystem
Current informationsystem
protected
Informationsystem_Model
$_oCurrentInformationsystem
$_oCurrentItem
Current item
protected
Informationsystem_Item_Model
$_oCurrentItem
$_propertiesValues
Properties values
protected
array<string|int, mixed>
$_propertiesValues
= array()
$_sBigImageFile
Path of the big image
protected
string
$_sBigImageFile
= ''
$_sCurrentTags
Current tags
protected
string
$_sCurrentTags
$_sSmallImageFile
Path of the small image
protected
string
$_sSmallImageFile
= ''
$_unlimitedProperties
Object has unlimited number of properties
protected
bool
$_unlimitedProperties
= \FALSE
$_UpdatedGroupsCount
Count of updated groups
protected
int
$_UpdatedGroupsCount
$_UpdatedItemsCount
Count of updated items
protected
int
$_UpdatedItemsCount
Methods
__construct()
Constructor.
public
__construct(int $iCurrentInformationsystemId[, int $iCurrentGroupId = 0 ]) : mixed
Parameters
- $iCurrentInformationsystemId : int
-
Informationsystem ID
- $iCurrentGroupId : int = 0
-
current group ID
__sleep()
Execute some routine before serialization
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__toString()
Convert object to string
public
__toString() : string
Return values
string__wakeup()
Reestablish any database connections that may have been lost during serialization and perform other reinitialization tasks
public
__wakeup() : self
Return values
selfaddAllowedProperties()
Add additional allowed properties
public
addAllowedProperties(array<string|int, mixed> $array) : self
Parameters
- $array : array<string|int, mixed>
-
array of properties' names
Return values
selfaddAllowedProperty()
Add additional allowed property
public
addAllowedProperty(string $property) : self
Parameters
- $property : string
-
property name
Return values
selfclear()
Clear object
public
clear() : self
Return values
selfCorrectToEncoding()
Correct CSV-line encoding
public
static CorrectToEncoding(array<string|int, mixed> $sLine, string $encodeTo[, string $encodeFrom = 'UTF-8' ]) : array<string|int, mixed>
Parameters
- $sLine : array<string|int, mixed>
-
current CSV-file line
- $encodeTo : string
-
detination encoding
- $encodeFrom : string = 'UTF-8'
-
source encoding
Tags
Return values
array<string|int, mixed>getCSVLine()
Get CSV line from file
public
getCSVLine(mixed $fileDescriptor) : array<string|int, mixed>
Parameters
- $fileDescriptor : mixed
Return values
array<string|int, mixed>getInsertedGroupsCount()
Get inserted groups count
public
getInsertedGroupsCount() : int
Return values
intgetInsertedItemsCount()
Get inserted items count
public
getInsertedItemsCount() : int
Return values
intgetUpdatedGroupsCount()
Get updated groups count
public
getUpdatedGroupsCount() : int
Return values
intgetUpdatedItemsCount()
Get updated items count
public
getUpdatedItemsCount() : int
Return values
intimport()
Импорт CSV
public
import() : mixed
Tags
set()
Run when writing data to inaccessible properties
public
set(string $property, string $value) : self
Parameters
- $property : string
-
property name
- $value : string
-
property value
Return values
selfsetCurrentItem()
Set $this->_oCurrentItem
public
setCurrentItem(Informationsystem_Item_Model $oCurrentItem) : self
Parameters
- $oCurrentItem : Informationsystem_Item_Model
Return values
selfsetUnlimitedProperties()
Set unlimitedProperties
public
setUnlimitedProperties([bool $value = TRUE ]) : self
Parameters
- $value : bool = TRUE
-
default TRUR
Return values
self_convertToPunycode()
Convert url to Punycode
protected
_convertToPunycode(string $url) : string
Parameters
- $url : string
Return values
string_doSaveGroup()
Save group
protected
_doSaveGroup(Informationsystem_Group_Model $oInformationsystem_Group) : Informationsystem_Group
Parameters
- $oInformationsystem_Group : Informationsystem_Group_Model
-
group
Return values
Informationsystem_Group_downloadHttpFile()
Download file to the TMP dir
protected
_downloadHttpFile(string $sSourceFile) : path
Parameters
- $sSourceFile : string
Return values
path —to the file
_getTags()
Get cached tags of array
protected
_getTags() : array<string|int, mixed>
Return values
array<string|int, mixed>_incInsertedGroups()
Increment inserted groups
protected
_incInsertedGroups(int $iGroupId) : self
Parameters
- $iGroupId : int
-
group ID
Return values
self_incInsertedItems()
Increment inserted items
protected
_incInsertedItems(int $iItemId) : self
Parameters
- $iItemId : int
-
item ID
Return values
self_incUpdatedGroups()
Increment updated groups
protected
_incUpdatedGroups(int $iGroupId) : self
Parameters
- $iGroupId : int
-
group ID
Return values
self_incUpdatedItems()
Increment updated items
protected
_incUpdatedItems(int $iItemId) : self
Parameters
- $iItemId : int
-
item ID
Return values
selfinit()
Initialization
protected
init() : self