Deal extends Factory
Table of Contents
Methods
- __construct() : mixed
- checkIfTotalItemsCountExceeded() : bool
- clearCategoriesCache() : self
- clearFieldsCollectionCache() : self
- clearItemCategoryCache() : void
- clearItemStageCache() : void
- clearUserFieldsInfoCache() : mixed
- createCategory() : Category
- Creates new category.
- createDefaultCategoryIfNotExist() : Category
- Get default category if it exists.
- createItem() : Item
- Creates new Item for this entity.
- getAddOperation() : Add
- Returns add operation for this entity.
- getCategories() : array<string|int, Category>
- Returns array of categories for this entity.
- getCategory() : Category|null
- Returns category by id.
- getCategoryByCode() : Category|null
- Returns category by specified unique code.
- getCategoryFieldsInfo() : array<string|int, mixed>
- getCommonFieldNameByMap() : string
- Replaces entity-specific name with common Item field name (Item::FIELD_NAME_*) if it's needed
- getConversionOperation() : Conversion
- getCopyOperation() : Copy
- Returns a configured Operation\Copy instance
- getCountersSettings() : EntityCounterSettings
- Return actual counters settings.
- getDataClass() : string
- getDefaultCategory() : Category|null
- Returns default category of current entity if it exists.
- getDeleteOperation() : Delete
- Returns delete operation for this entity
- getDependantFieldsMap() : array<string|int, mixed>
- getEditorAdapter() : EditorAdapter
- getEntityAbbreviation() : string
- Returns abbreviation for this entity
- getEntityDescription() : string
- Returns human-readable language specific description for this entity
- getEntityDescriptionInPlural() : string
- Return human-readable language specific description for category of items of this entity.
- getEntityFieldNameByMap() : string
- Replaces common Item field name (Item::FIELD_NAME_*) with entity-specific name if it's needed
- getEntityName() : string
- Returns name of this entity
- getEntityTypeId() : int
- Returns entityTypeId for this factory.
- getFieldCaption() : string
- Returns language-specific title of $commonFieldName. If not title is not found, returns $commonFieldName
- getFieldsCollection() : Collection
- Returns collection of all fields of this entity type. (Even those, that are not visible for current user).
- getFieldsInfo() : array<string|int, mixed>
- Returns data about item fields with titles.
- getFieldsInfoByMap() : array<string|int, mixed>
- Returns data about item fields with fields map applied
- getFieldsMap() : array<string|int, string>
- Returns map of common field names that have entity-specific name for the entity
- getFieldValueCaption() : string
- getImportOperation() : Import
- getItem() : Item|null
- Returns Item by $id. Contacts, products and observers are selected by default
- getItemByEntityObject() : Item
- getItemCategory() : Category|null
- Return category of the item with $id.
- getItemCategoryId() : int|null
- Return category identifier of the item with $id.
- getItems() : array<string|int, Item>
- Returns collection of items defined by $parameters, where $parameters - array of the same structure as in DataManager::getList()
- getItemsCount() : int
- Returns number of items filtered by $filter.
- getItemsCountFilteredByPermissions() : int
- Returns number of items filtered by $filter with additional filter by permissions.
- getItemsFilteredByPermissions() : array<string|int, mixed>
- Method performs getList with additional filter by users permissions.
- getItemStageId() : string|null
- getRestoreOperation() : Restore
- getStage() : EO_Status|null
- getStages() : EO_Status_Collection
- Returns stages for $categoryId.
- getStageSemantics() : string|null
- Returns semantics of a stage with $stageId Returns null if the stage is not found
- getStagesEntityId() : string|null
- Returns ENTITY_ID value for b_crm_status table.
- getSuccessfulStage() : EO_Status|null
- getTrackedObject() : TrackedObject
- Returns TrackedObject, specific for this entity
- getUpdateOperation() : Update
- Returns update operations for this entity.
- getUserFieldEntityId() : string
- Returns ENTITY_ID for user fields.
- getUserFields() : array<string|int, mixed>
- Returns all user fields of this entity type. (Even those, that are not visible for current user).
- getUserFieldsInfo() : array<string|int, mixed>
- Returns fields info of all user fields of this entity type. (Even those, that are not visible for current user).
- isAutomationEnabled() : bool
- Returns true if this entity supported by automation.
- isBeginCloseDatesEnabled() : bool
- Returns true if this entity supports 'Begin Date' and 'Close Date' for its elements
- isBizProcEnabled() : bool
- Returns true if this entity supported by business processes designer.
- isCategoriesEnabled() : bool
- Returns true if this entity supports categories and they enabled in interfaces.
- isCategoriesSupported() : bool
- Returns true if this entity supports categories.
- isCategoryAvailable() : bool
- Returns true if the category with the provided $categoryId is available for usage (is not locked or restricted)
- isCategoryExists() : bool
- isClientEnabled() : bool
- Returns true if this entity supports 'Client' field for its elements
- isCommunicationRoutingSupported() : bool
- isCountersEnabled() : bool
- Returns true if this entity supports counters.
- isCrmTrackingEnabled() : bool
- Returns true if this entity supports Crm Tracking
- isDeferredCleaningEnabled() : bool
- Returns true if after item deletion data that was linked to the item is deleted on agent by default
- isDocumentGenerationEnabled() : bool
- Returns true if this entity supports integration with 'documentgenerator' module
- isFieldExists() : bool
- isInCustomSection() : bool
- isInventoryManagementEnabled() : bool
- Return true if inventory management is enabled for this entity.
- isLastActivityEnabled() : bool
- Returns true if 'last activity' functionality is enabled in UI
- isLastActivitySupported() : bool
- Returns true if this entity supports LAST_ACTIVITY_* fields and all associated logic
- isLinkWithProductsEnabled() : bool
- Returns true if this entity supports links with Catalog products
- isMultiFieldsEnabled() : bool
- Return true if this entity has own multi fields.
- isMultipleAssignedEnabled() : bool
- Returns true if this entity supports multiple assigned.
- isMyCompanyEnabled() : bool
- Returns true if this entity supports 'My Company' field for its elements
- isNewRoutingForAutomationEnabled() : bool
- Return true if urls for automation page of this entity should be routed by common templates
- isNewRoutingForDetailEnabled() : bool
- Return true if urls for detail pages of this entity should be routed by common templates
- isNewRoutingForListEnabled() : bool
- Return true if urls for list pages of this entity should be routed by common templates
- isObserversEnabled() : bool
- Returns true if this entity supports OBSERVERS field.
- isPaymentsEnabled() : bool
- Return true if payments procession is enabled for this entity.
- isRecyclebinEnabled() : bool
- Returns true if this entity supports recycle bin.
- isSmartActivityNotificationEnabled() : bool
- isSmartActivityNotificationSupported() : bool
- isSourceEnabled() : bool
- Returns true if this entity supports 'SOURCE_ID' and 'SOURCE_DESCRIPTION' fields for its elements
- isStagesEnabled() : bool
- isStagesSupported() : bool
- Returns true if this entity supports stages.
- isUseInUserfieldEnabled() : bool
- Returns true if this entity can be used in user field type 'crm'.
- purgeStagesCache() : Factory
- setStartStageIdPermittedForUser() : string|null
- Set first available stage of $item for user with $userId.
Methods
__construct()
public
__construct() : mixed
checkIfTotalItemsCountExceeded()
public
checkIfTotalItemsCountExceeded(int $limit[, array<string|int, mixed> $filter = [] ]) : bool
Parameters
- $limit : int
- $filter : array<string|int, mixed> = []
Return values
boolclearCategoriesCache()
public
clearCategoriesCache() : self
Return values
selfclearFieldsCollectionCache()
public
clearFieldsCollectionCache() : self
Return values
selfclearItemCategoryCache()
public
clearItemCategoryCache(int $id) : void
Parameters
- $id : int
clearItemStageCache()
public
clearItemStageCache(int $id) : void
Parameters
- $id : int
clearUserFieldsInfoCache()
public
clearUserFieldsInfoCache() : mixed
createCategory()
Creates new category.
public
createCategory([array<string|int, mixed> $data = [] ]) : Category
Parameters
- $data : array<string|int, mixed> = []
-
. Initial data for created category.
Return values
CategorycreateDefaultCategoryIfNotExist()
Get default category if it exists.
public
createDefaultCategoryIfNotExist() : Category
Creates new default category if there is none and returns it.
Tags
Return values
CategorycreateItem()
Creates new Item for this entity.
public
createItem([array<string|int, mixed> $data = [] ]) : Item
Parameters
- $data : array<string|int, mixed> = []
Return values
ItemgetAddOperation()
Returns add operation for this entity.
public
getAddOperation(Item $item[, Context|null $context = null ]) : Add
Parameters
- $item : Item
- $context : Context|null = null
Return values
AddgetCategories()
Returns array of categories for this entity.
public
getCategories() : array<string|int, Category>
Return values
array<string|int, Category>getCategory()
Returns category by id.
public
getCategory(int $id) : Category|null
Parameters
- $id : int
Return values
Category|nullgetCategoryByCode()
Returns category by specified unique code.
public
getCategoryByCode(string $code) : Category|null
Parameters
- $code : string
Return values
Category|nullgetCategoryFieldsInfo()
public
getCategoryFieldsInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>getCommonFieldNameByMap()
Replaces entity-specific name with common Item field name (Item::FIELD_NAME_*) if it's needed
public
getCommonFieldNameByMap(string $entityFieldName) : string
Parameters
- $entityFieldName : string
Tags
Return values
stringgetConversionOperation()
public
getConversionOperation(Item $item, EntityConversionConfig $configs[, Context $context = null ]) : Conversion
Parameters
- $item : Item
- $configs : EntityConversionConfig
- $context : Context = null
Return values
ConversiongetCopyOperation()
Returns a configured Operation\Copy instance
public
getCopyOperation(Item $item[, Context|null $context = null ]) : Copy
Parameters
- $item : Item
- $context : Context|null = null
Return values
CopygetCountersSettings()
Return actual counters settings.
public
getCountersSettings() : EntityCounterSettings
Return values
EntityCounterSettingsgetDataClass()
public
getDataClass() : string
Return values
stringgetDefaultCategory()
Returns default category of current entity if it exists.
public
getDefaultCategory() : Category|null
Return values
Category|nullgetDeleteOperation()
Returns delete operation for this entity
public
getDeleteOperation(Item $item[, Context $context = null ]) : Delete
Parameters
- $item : Item
- $context : Context = null
Return values
DeletegetDependantFieldsMap()
public
getDependantFieldsMap() : array<string|int, mixed>
Return values
array<string|int, mixed>getEditorAdapter()
public
getEditorAdapter() : EditorAdapter
Return values
EditorAdaptergetEntityAbbreviation()
Returns abbreviation for this entity
public
getEntityAbbreviation() : string
Return values
stringgetEntityDescription()
Returns human-readable language specific description for this entity
public
getEntityDescription() : string
Return values
stringgetEntityDescriptionInPlural()
Return human-readable language specific description for category of items of this entity.
public
getEntityDescriptionInPlural() : string
Return values
stringgetEntityFieldNameByMap()
Replaces common Item field name (Item::FIELD_NAME_*) with entity-specific name if it's needed
public
getEntityFieldNameByMap(string $commonFieldName) : string
Parameters
- $commonFieldName : string
Tags
Return values
stringgetEntityName()
Returns name of this entity
public
getEntityName() : string
Return values
stringgetEntityTypeId()
Returns entityTypeId for this factory.
public
getEntityTypeId() : int
Return values
intgetFieldCaption()
Returns language-specific title of $commonFieldName. If not title is not found, returns $commonFieldName
public
getFieldCaption(string $commonFieldName) : string
Parameters
- $commonFieldName : string
Return values
stringgetFieldsCollection()
Returns collection of all fields of this entity type. (Even those, that are not visible for current user).
public
getFieldsCollection() : Collection
Return values
CollectiongetFieldsInfo()
Returns data about item fields with titles.
public
getFieldsInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>getFieldsInfoByMap()
Returns data about item fields with fields map applied
public
getFieldsInfoByMap() : array<string|int, mixed>
Return values
array<string|int, mixed>getFieldsMap()
Returns map of common field names that have entity-specific name for the entity
public
getFieldsMap() : array<string|int, string>
Tags
Return values
array<string|int, string> —commonFieldName => entityFieldName
getFieldValueCaption()
public
getFieldValueCaption(string $commonFieldName, mixed $fieldValue) : string
Parameters
- $commonFieldName : string
- $fieldValue : mixed
Return values
stringgetImportOperation()
public
getImportOperation(Item $item[, Context $context = null ]) : Import
Parameters
- $item : Item
- $context : Context = null
Return values
ImportgetItem()
Returns Item by $id. Contacts, products and observers are selected by default
public
getItem(int $id[, array<string|int, mixed> $fieldsToSelect = ['*'] ]) : Item|null
Parameters
- $id : int
- $fieldsToSelect : array<string|int, mixed> = ['*']
-
Fields to select. All fields by default.
Return values
Item|nullgetItemByEntityObject()
public
final getItemByEntityObject(EntityObject $object) : Item
Parameters
- $object : EntityObject
Return values
ItemgetItemCategory()
Return category of the item with $id.
public
getItemCategory(int $id) : Category|null
Parameters
- $id : int
-
- Item identifier.
Return values
Category|nullgetItemCategoryId()
Return category identifier of the item with $id.
public
getItemCategoryId(int $id) : int|null
If categories are not supported - returns 0. If no item - returns null.
Parameters
- $id : int
-
- Item identifier.
Return values
int|nullgetItems()
Returns collection of items defined by $parameters, where $parameters - array of the same structure as in DataManager::getList()
public
getItems([array<string|int, mixed> $parameters = [] ]) : array<string|int, Item>
Parameters
- $parameters : array<string|int, mixed> = []
Return values
array<string|int, Item>getItemsCount()
Returns number of items filtered by $filter.
public
getItemsCount([array<string|int, mixed> $filter = [] ]) : int
Parameters
- $filter : array<string|int, mixed> = []
Return values
intgetItemsCountFilteredByPermissions()
Returns number of items filtered by $filter with additional filter by permissions.
public
getItemsCountFilteredByPermissions([array<string|int, mixed> $filter = [] ][, int|null $userId = null ][, string $operation = UserPermissions::OPERATION_READ ]) : int
Parameters
- $filter : array<string|int, mixed> = []
-
- Filter to count items with.
- $userId : int|null = null
-
- User identifier to check permissions.
- $operation : string = UserPermissions::OPERATION_READ
-
- Operation type.
Return values
intgetItemsFilteredByPermissions()
Method performs getList with additional filter by users permissions.
public
getItemsFilteredByPermissions(array<string|int, mixed> $parameters[, int|null $userId = null ][, string|null $operation = UserPermissions::OPERATION_READ ]) : array<string|int, mixed>
First - collect all permissionTypes depending on current filter. If categories are not supported - there is only one type. If there is filter by categories - get all types for them. If there is not filter by categories - we should collect all existing categories. After collecting all types we can calculate sql for ids an apply it to the filter.
Parameters
- $parameters : array<string|int, mixed>
-
- getList orm parameters.
- $userId : int|null = null
-
- user identifier for which should be calculated permissions. If not passed - get current user.
- $operation : string|null = UserPermissions::OPERATION_READ
-
- type of operation to check permissions.
Return values
array<string|int, mixed>getItemStageId()
public
final getItemStageId(int $id) : string|null
Parameters
- $id : int
Return values
string|nullgetRestoreOperation()
public
getRestoreOperation(Item $item[, Context $context = null ]) : Restore
Parameters
- $item : Item
- $context : Context = null
Return values
RestoregetStage()
public
getStage(string $statusId) : EO_Status|null
Parameters
- $statusId : string
Return values
EO_Status|nullgetStages()
Returns stages for $categoryId.
public
getStages([int|null $categoryId = null ]) : EO_Status_Collection
Parameters
- $categoryId : int|null = null
Return values
EO_Status_CollectiongetStageSemantics()
Returns semantics of a stage with $stageId Returns null if the stage is not found
public
final getStageSemantics(string $stageId) : string|null
Parameters
- $stageId : string
Return values
string|nullgetStagesEntityId()
Returns ENTITY_ID value for b_crm_status table.
public
getStagesEntityId([int|null $categoryId = null ]) : string|null
Parameters
- $categoryId : int|null = null
-
- by default $categoryId from a default category is used. If categories are not supported, this parameter is ignored
Tags
Return values
string|nullgetSuccessfulStage()
public
final getSuccessfulStage([int|null $categoryId = null ]) : EO_Status|null
Parameters
- $categoryId : int|null = null
Return values
EO_Status|nullgetTrackedObject()
Returns TrackedObject, specific for this entity
public
getTrackedObject(Item $itemBeforeSave[, Item|null $item = null ]) : TrackedObject
Parameters
- $itemBeforeSave : Item
- $item : Item|null = null
Return values
TrackedObjectgetUpdateOperation()
Returns update operations for this entity.
public
getUpdateOperation(Item $item[, Context $context = null ]) : Update
Parameters
- $item : Item
- $context : Context = null
Return values
UpdategetUserFieldEntityId()
Returns ENTITY_ID for user fields.
public
getUserFieldEntityId() : string
Return values
stringgetUserFields()
Returns all user fields of this entity type. (Even those, that are not visible for current user).
public
getUserFields() : array<string|int, mixed>
Return values
array<string|int, mixed>getUserFieldsInfo()
Returns fields info of all user fields of this entity type. (Even those, that are not visible for current user).
public
getUserFieldsInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>isAutomationEnabled()
Returns true if this entity supported by automation.
public
isAutomationEnabled() : bool
Return values
boolisBeginCloseDatesEnabled()
Returns true if this entity supports 'Begin Date' and 'Close Date' for its elements
public
isBeginCloseDatesEnabled() : bool
Return values
boolisBizProcEnabled()
Returns true if this entity supported by business processes designer.
public
isBizProcEnabled() : bool
Return values
boolisCategoriesEnabled()
Returns true if this entity supports categories and they enabled in interfaces.
public
isCategoriesEnabled() : bool
Return values
boolisCategoriesSupported()
Returns true if this entity supports categories.
public
isCategoriesSupported() : bool
Return values
boolisCategoryAvailable()
Returns true if the category with the provided $categoryId is available for usage (is not locked or restricted)
public
isCategoryAvailable(int $categoryId) : bool
Parameters
- $categoryId : int
Return values
boolisCategoryExists()
public
isCategoryExists(int $categoryId) : bool
Parameters
- $categoryId : int
Return values
boolisClientEnabled()
Returns true if this entity supports 'Client' field for its elements
public
isClientEnabled() : bool
Return values
boolisCommunicationRoutingSupported()
public
isCommunicationRoutingSupported() : bool
Return values
boolisCountersEnabled()
Returns true if this entity supports counters.
public
isCountersEnabled() : bool
Return values
boolisCrmTrackingEnabled()
Returns true if this entity supports Crm Tracking
public
isCrmTrackingEnabled() : bool
Return values
boolisDeferredCleaningEnabled()
Returns true if after item deletion data that was linked to the item is deleted on agent by default
public
isDeferredCleaningEnabled() : bool
Return values
boolisDocumentGenerationEnabled()
Returns true if this entity supports integration with 'documentgenerator' module
public
isDocumentGenerationEnabled() : bool
Return values
boolisFieldExists()
public
isFieldExists(string $commonFieldName) : bool
Parameters
- $commonFieldName : string
Return values
boolisInCustomSection()
public
isInCustomSection() : bool
Return values
boolisInventoryManagementEnabled()
Return true if inventory management is enabled for this entity.
public
isInventoryManagementEnabled() : bool
Return values
boolisLastActivityEnabled()
Returns true if 'last activity' functionality is enabled in UI
public
isLastActivityEnabled() : bool
Return values
boolisLastActivitySupported()
Returns true if this entity supports LAST_ACTIVITY_* fields and all associated logic
public
isLastActivitySupported() : bool
Return values
boolisLinkWithProductsEnabled()
Returns true if this entity supports links with Catalog products
public
isLinkWithProductsEnabled() : bool
Return values
boolisMultiFieldsEnabled()
Return true if this entity has own multi fields.
public
isMultiFieldsEnabled() : bool
Return values
boolisMultipleAssignedEnabled()
Returns true if this entity supports multiple assigned.
public
isMultipleAssignedEnabled() : bool
Return values
boolisMyCompanyEnabled()
Returns true if this entity supports 'My Company' field for its elements
public
isMyCompanyEnabled() : bool
Return values
boolisNewRoutingForAutomationEnabled()
Return true if urls for automation page of this entity should be routed by common templates
public
isNewRoutingForAutomationEnabled() : bool
Return values
boolisNewRoutingForDetailEnabled()
Return true if urls for detail pages of this entity should be routed by common templates
public
isNewRoutingForDetailEnabled() : bool
Return values
boolisNewRoutingForListEnabled()
Return true if urls for list pages of this entity should be routed by common templates
public
isNewRoutingForListEnabled() : bool
Return values
boolisObserversEnabled()
Returns true if this entity supports OBSERVERS field.
public
isObserversEnabled() : bool
Return values
boolisPaymentsEnabled()
Return true if payments procession is enabled for this entity.
public
isPaymentsEnabled() : bool
Return values
boolisRecyclebinEnabled()
Returns true if this entity supports recycle bin.
public
isRecyclebinEnabled() : bool
Return values
boolisSmartActivityNotificationEnabled()
public
isSmartActivityNotificationEnabled() : bool
Return values
boolisSmartActivityNotificationSupported()
public
isSmartActivityNotificationSupported() : bool
Return values
boolisSourceEnabled()
Returns true if this entity supports 'SOURCE_ID' and 'SOURCE_DESCRIPTION' fields for its elements
public
isSourceEnabled() : bool
Return values
boolisStagesEnabled()
public
isStagesEnabled() : bool
Return values
boolisStagesSupported()
Returns true if this entity supports stages.
public
isStagesSupported() : bool
Return values
boolisUseInUserfieldEnabled()
Returns true if this entity can be used in user field type 'crm'.
public
isUseInUserfieldEnabled() : bool
Return values
boolpurgeStagesCache()
public
purgeStagesCache() : Factory
Return values
FactorysetStartStageIdPermittedForUser()
Set first available stage of $item for user with $userId.
public
setStartStageIdPermittedForUser(Item $item[, int|null $userId = null ]) : string|null
Return new stage identifier if it was set.
Parameters
- $item : Item
-
- Item to set stageId.
- $userId : int|null = null
-
- user identifier.