Overview

Namespaces

  • Glpi
    • Cache
    • Console
      • Command
      • Database
      • Ldap
      • Migration
      • Security
      • Task
    • Exception
  • None

Classes

  • AbstractQuery
  • Ajax
  • Alert
  • API
  • APIClient
  • APIRest
  • APIXmlrpc
  • Auth
  • AuthLDAP
  • AuthLdapReplicate
  • AuthMail
  • AutoUpdateSystem
  • Blacklist
  • BlacklistedMailContent
  • Budget
  • BudgetType
  • BusinessCriticity
  • Calendar
  • Calendar_Holiday
  • CalendarSegment
  • Cartridge
  • CartridgeItem
  • CartridgeItem_PrinterModel
  • CartridgeItemType
  • Central
  • Certificate
  • Certificate_Item
  • CertificateType
  • Change
  • Change_Group
  • Change_Item
  • Change_Problem
  • Change_Supplier
  • Change_Ticket
  • Change_User
  • ChangeCost
  • ChangeTask
  • ChangeValidation
  • CliMigration
  • CommonDBChild
  • CommonDBConnexity
  • CommonDBRelation
  • CommonDBTM
  • CommonDBVisible
  • CommonDCModelDropdown
  • CommonDevice
  • CommonDeviceModel
  • CommonDeviceType
  • CommonDropdown
  • CommonGLPI
  • CommonImplicitTreeDropdown
  • CommonITILActor
  • CommonITILCost
  • CommonITILObject
  • CommonITILTask
  • CommonITILValidation
  • CommonTreeDropdown
  • Computer
  • Computer_Item
  • Computer_SoftwareLicense
  • Computer_SoftwareVersion
  • ComputerAntivirus
  • ComputerModel
  • ComputerType
  • ComputerVirtualMachine
  • Config
  • Consumable
  • ConsumableItem
  • ConsumableItemType
  • Contact
  • Contact_Supplier
  • ContactType
  • Contract
  • Contract_Item
  • Contract_Supplier
  • ContractCost
  • ContractType
  • CronTask
  • CronTaskLog
  • Datacenter
  • DBConnection
  • DBmysql
  • DBmysqlIterator
  • DbUtils
  • DCRoom
  • DeviceBattery
  • DeviceBatteryModel
  • DeviceBatteryType
  • DeviceCase
  • DeviceCaseModel
  • DeviceCaseType
  • DeviceControl
  • DeviceControlModel
  • DeviceDrive
  • DeviceDriveModel
  • DeviceFirmware
  • DeviceFirmwareModel
  • DeviceFirmwareType
  • DeviceGeneric
  • DeviceGenericModel
  • DeviceGenericType
  • DeviceGraphicCard
  • DeviceGraphicCardModel
  • DeviceHardDrive
  • DeviceHardDriveModel
  • DeviceMemory
  • DeviceMemoryModel
  • DeviceMemoryType
  • DeviceMotherboard
  • DeviceMotherBoardModel
  • DeviceNetworkCard
  • DeviceNetworkCardModel
  • DevicePci
  • DevicePciModel
  • DevicePowerSupply
  • DevicePowerSupplyModel
  • DeviceProcessor
  • DeviceProcessorModel
  • DeviceSensor
  • DeviceSensorModel
  • DeviceSensorType
  • DeviceSimcard
  • DeviceSimcardType
  • DeviceSoundCard
  • DeviceSoundCardModel
  • DisplayPreference
  • Document
  • Document_Item
  • DocumentCategory
  • DocumentType
  • Domain
  • Dropdown
  • DropdownTranslation
  • Enclosure
  • EnclosureModel
  • Entity
  • Entity_KnowbaseItem
  • Entity_Reminder
  • Entity_RSSFeed
  • Fieldblacklist
  • FieldUnicity
  • Filesystem
  • FQDN
  • FQDNLabel
  • GLPI
  • GLPIKey
  • GLPIMailer
  • GLPINetwork
  • GLPIPDF
  • GLPIUploadHandler
  • Group
  • Group_KnowbaseItem
  • Group_Problem
  • Group_Reminder
  • Group_RSSFeed
  • Group_Ticket
  • Group_User
  • Holiday
  • Html
  • HTMLTableBase
  • HTMLTableCell
  • HTMLTableEntity
  • HTMLTableGroup
  • HTMLTableHeader
  • HTMLTableMain
  • HTMLTableRow
  • HTMLTableSubHeader
  • HTMLTableSuperHeader
  • Infocom
  • InterfaceType
  • IPAddress
  • IPAddress_IPNetwork
  • IPNetmask
  • IPNetwork
  • IPNetwork_Vlan
  • Item_DeviceBattery
  • Item_DeviceCase
  • Item_DeviceControl
  • Item_DeviceDrive
  • Item_DeviceFirmware
  • Item_DeviceGeneric
  • Item_DeviceGraphicCard
  • Item_DeviceHardDrive
  • Item_DeviceMemory
  • Item_DeviceMotherboard
  • Item_DeviceNetworkCard
  • Item_DevicePci
  • Item_DevicePowerSupply
  • Item_DeviceProcessor
  • Item_Devices
  • Item_DeviceSensor
  • Item_DeviceSimcard
  • Item_DeviceSoundCard
  • Item_Disk
  • Item_Enclosure
  • Item_OperatingSystem
  • Item_Problem
  • Item_Project
  • Item_Rack
  • Item_Ticket
  • Itil_Project
  • ITILCategory
  • ITILFollowup
  • ITILSolution
  • Knowbase
  • KnowbaseItem
  • KnowbaseItem_Comment
  • KnowbaseItem_Item
  • KnowbaseItem_Profile
  • KnowbaseItem_Revision
  • KnowbaseItem_User
  • KnowbaseItemCategory
  • KnowbaseItemTranslation
  • LevelAgreement
  • LevelAgreementLevel
  • Line
  • LineOperator
  • LineType
  • Link
  • Link_Itemtype
  • Location
  • Lock
  • Log
  • MailCollector
  • Manufacturer
  • MassiveAction
  • Migration
  • MigrationCleaner
  • Monitor
  • MonitorModel
  • MonitorType
  • Netpoint
  • Network
  • NetworkAlias
  • NetworkEquipment
  • NetworkEquipmentModel
  • NetworkEquipmentType
  • NetworkInterface
  • NetworkName
  • NetworkPort
  • NetworkPort_NetworkPort
  • NetworkPort_Vlan
  • NetworkPortAggregate
  • NetworkPortAlias
  • NetworkPortDialup
  • NetworkPortEthernet
  • NetworkPortFiberchannel
  • NetworkPortInstantiation
  • NetworkPortLocal
  • NetworkPortMigration
  • NetworkPortWifi
  • Notepad
  • Notification
  • Notification_NotificationTemplate
  • NotificationAjax
  • NotificationAjaxSetting
  • NotificationEvent
  • NotificationEventAbstract
  • NotificationEventAjax
  • NotificationEventMailing
  • NotificationMailing
  • NotificationMailingSetting
  • NotificationSetting
  • NotificationSettingConfig
  • NotificationTarget
  • NotificationTargetCartridgeItem
  • NotificationTargetCertificate
  • NotificationTargetChange
  • NotificationTargetCommonITILObject
  • NotificationTargetConsumableItem
  • NotificationTargetContract
  • NotificationTargetCrontask
  • NotificationTargetDBConnection
  • NotificationTargetFieldUnicity
  • NotificationTargetInfocom
  • NotificationTargetMailCollector
  • NotificationTargetObjectLock
  • NotificationTargetPlanningRecall
  • NotificationTargetProblem
  • NotificationTargetProject
  • NotificationTargetProjectTask
  • NotificationTargetReservation
  • NotificationTargetSavedsearch_Alert
  • NotificationTargetSoftwareLicense
  • NotificationTargetTicket
  • NotificationTargetUser
  • NotificationTemplate
  • NotificationTemplateTranslation
  • NotImportedEmail
  • ObjectLock
  • OLA
  • OlaLevel
  • OlaLevel_Ticket
  • OlaLevelAction
  • OlaLevelCriteria
  • OperatingSystem
  • OperatingSystemArchitecture
  • OperatingSystemEdition
  • OperatingSystemKernel
  • OperatingSystemKernelVersion
  • OperatingSystemServicePack
  • OperatingSystemVersion
  • PDU
  • Pdu_Plug
  • PDU_Rack
  • PDUModel
  • PDUType
  • Peripheral
  • PeripheralModel
  • PeripheralType
  • Phone
  • PhoneModel
  • PhonePowerSupply
  • PhoneType
  • Planning
  • PlanningRecall
  • Plug
  • Plugin
  • Preference
  • Printer
  • PrinterModel
  • PrinterType
  • Problem
  • Problem_Supplier
  • Problem_Ticket
  • Problem_User
  • ProblemCost
  • ProblemTask
  • Profile
  • Profile_Reminder
  • Profile_RSSFeed
  • Profile_User
  • ProfileRight
  • Project
  • ProjectCost
  • ProjectState
  • ProjectTask
  • ProjectTask_Ticket
  • ProjectTaskTeam
  • ProjectTaskTemplate
  • ProjectTaskType
  • ProjectTeam
  • ProjectType
  • PurgeLogs
  • QueryExpression
  • QueryParam
  • QuerySubQuery
  • QueryUnion
  • QueuedNotification
  • Rack
  • RackModel
  • RackType
  • RegisteredID
  • Reminder
  • Reminder_User
  • Report
  • RequestType
  • Reservation
  • ReservationItem
  • RSSFeed
  • RSSFeed_User
  • Rule
  • RuleAction
  • RuleAsset
  • RuleAssetCollection
  • RuleCollection
  • RuleCriteria
  • RuleDictionnaryComputerModel
  • RuleDictionnaryComputerModelCollection
  • RuleDictionnaryComputerType
  • RuleDictionnaryComputerTypeCollection
  • RuleDictionnaryDropdown
  • RuleDictionnaryDropdownCollection
  • RuleDictionnaryManufacturer
  • RuleDictionnaryManufacturerCollection
  • RuleDictionnaryMonitorModel
  • RuleDictionnaryMonitorModelCollection
  • RuleDictionnaryMonitorType
  • RuleDictionnaryMonitorTypeCollection
  • RuleDictionnaryNetworkEquipmentModel
  • RuleDictionnaryNetworkEquipmentModelCollection
  • RuleDictionnaryNetworkEquipmentType
  • RuleDictionnaryNetworkEquipmentTypeCollection
  • RuleDictionnaryOperatingSystem
  • RuleDictionnaryOperatingSystemArchitecture
  • RuleDictionnaryOperatingSystemArchitectureCollection
  • RuleDictionnaryOperatingSystemCollection
  • RuleDictionnaryOperatingSystemServicePack
  • RuleDictionnaryOperatingSystemServicePackCollection
  • RuleDictionnaryOperatingSystemVersion
  • RuleDictionnaryOperatingSystemVersionCollection
  • RuleDictionnaryPeripheralModel
  • RuleDictionnaryPeripheralModelCollection
  • RuleDictionnaryPeripheralType
  • RuleDictionnaryPeripheralTypeCollection
  • RuleDictionnaryPhoneModel
  • RuleDictionnaryPhoneModelCollection
  • RuleDictionnaryPhoneType
  • RuleDictionnaryPhoneTypeCollection
  • RuleDictionnaryPrinter
  • RuleDictionnaryPrinterCollection
  • RuleDictionnaryPrinterModel
  • RuleDictionnaryPrinterModelCollection
  • RuleDictionnaryPrinterType
  • RuleDictionnaryPrinterTypeCollection
  • RuleDictionnarySoftware
  • RuleDictionnarySoftwareCollection
  • RuleImportComputer
  • RuleImportComputerCollection
  • RuleImportEntity
  • RuleImportEntityCollection
  • RuleMailCollector
  • RuleMailCollectorCollection
  • RuleRight
  • RuleRightCollection
  • RuleRightParameter
  • RuleSoftwareCategory
  • RuleSoftwareCategoryCollection
  • RuleTicket
  • RuleTicketCollection
  • SavedSearch
  • SavedSearch_Alert
  • SavedSearch_User
  • Search
  • Session
  • SingletonRuleList
  • SLA
  • SlaLevel
  • SlaLevel_Ticket
  • SlaLevelAction
  • SlaLevelCriteria
  • SLM
  • Software
  • SoftwareCategory
  • SoftwareLicense
  • SoftwareLicenseType
  • SoftwareVersion
  • SolutionTemplate
  • SolutionType
  • SsoVariable
  • Stat
  • State
  • Supplier
  • Supplier_Ticket
  • SupplierType
  • TaskCategory
  • TaskTemplate
  • Telemetry
  • Ticket
  • Ticket_Ticket
  • Ticket_User
  • TicketCost
  • TicketFollowup
  • TicketRecurrent
  • TicketSatisfaction
  • TicketTask
  • TicketTemplate
  • TicketTemplateHiddenField
  • TicketTemplateMandatoryField
  • TicketTemplatePredefinedField
  • TicketValidation
  • Timer
  • Toolbox
  • Transfer
  • Update
  • User
  • UserCategory
  • UserEmail
  • UserTitle
  • VirtualMachineState
  • VirtualMachineSystem
  • VirtualMachineType
  • Vlan
  • WifiNetwork
  • XHProf
  • XML

Interfaces

  • NotificationEventInterface
  • NotificationInterface

Traits

  • DCBreadcrumb

Exceptions

  • CommonDBConnexityItemNotFound
  • HTMLTableCellFatherCoherentHeader
  • HTMLTableCellFatherSameRow
  • HTMLTableCellWithoutFather
  • HTMLTableUnknownHeader
  • HTMLTableUnknownHeaders
  • HTMLTableUnknownHeadersOrder

Functions

  • __
  • __s
  • _n
  • _nx
  • _sn
  • _sx
  • _x
  • autoName
  • closeDBConnections
  • contructListFromTree
  • contructTreeFromList
  • countDistinctElementsInTable
  • countElementsInTable
  • countElementsInTableForEntity
  • countElementsInTableForMyEntities
  • exportArrayToDB
  • formatUserName
  • get_hour_from_sql
  • getAllDatasFromTable
  • getAncestorsOf
  • getDateCriteria
  • getDateRequest
  • getDbRelations
  • getEntitiesRestrictCriteria
  • getEntitiesRestrictRequest
  • getForeignKeyFieldForItemType
  • getForeignKeyFieldForTable
  • getItemForItemtype
  • getItemtypeForForeignKeyField
  • getItemTypeForTable
  • getNextItem
  • getPlural
  • getPreviousItem
  • getRealQueryForTreeItem
  • getSingular
  • getSonsAndAncestorsOf
  • getSonsOf
  • getTableForItemType
  • getTableNameForForeignKeyField
  • getTreeForItem
  • getTreeLeafValueName
  • getTreeValueCompleteName
  • getTreeValueName
  • getUserName
  • glpi_autoload
  • importArrayFromDB
  • isAPI
  • isCommandLine
  • isForeignKeyField
  • isIndex
  • isPluginItemType
  • regenerateTreeCompleteName
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Class CommonDBConnexity

Common DataBase Connexity Table Manager Class This class factorize code for CommonDBChild and CommonDBRelation. Both classes themselves factorize and normalize the behaviour of all Child and Relations. As such, several elements are directly managed by these two classes since 0.84 : - Check: all can* methods (canCreate, canUpdate, canViewItem, canDeleteItem ...) are defined. - Update: when we try to update an attached element, we check if we change its parent item(s). If we change its parent(s), then we check if we can delete the item with previous parent(s) (cf. "check" before) AND we can create the item with the new parent(s). - Entity: Entity is automatically setted or updated when setting or changing an attached item. Thus, you don't have any more to worry about entities. (May be disable using $disableAutoEntityForwarding) - Log: when we create, update or delete an item, we update its parent(s)'s histories to notify them of the creation, update or deletion - Flying items : some items can be on the stock. For instance, before beeing plugged inside a computer, an Item_DeviceProcessor can be without any parent. It is now possible to define such items and transfer them from parent to parent.

The aim of the new check is that the rights on a Child or a Relation are driven by the parent(s): you can create, delete or update the item if and only if you can update its parent(s); you can view the item if and only if you can view its parent(s). Beware that it differs from the default behaviour of CommonDBTM: if you don't define canUpdate or canDelete, then it checks canCreate and by default canCreate returns false (thus, if you don't do anything, you don't have any right). A side effect is that if you define specific rights (see NetworkName::canCreate()) for your classes you must define all rights (canCreate, canView, canUpdate and canDelete).

CommonGLPI
Extended by CommonDBTM
Extended by CommonDBConnexity

Direct known subclasses

CommonDBChild, CommonDBRelation

Indirect known subclasses

Calendar_Holiday, CalendarSegment, Change_User, NotificationTargetCrontask, NotificationTargetDBConnection, NotificationTargetFieldUnicity, NotificationTargetInfocom, NotificationTargetMailCollector, NotificationTargetObjectLock, NotificationTargetPlanningRecall, NotificationTargetProblem, NotificationTargetProject, NotificationTargetProjectTask, ChangeCost, NotificationTargetReservation, NotificationTargetSavedsearch_Alert, NotificationTargetSoftwareLicense, NotificationTargetTicket, NotificationTargetUser, NotificationTemplateTranslation, OLA, OlaLevelAction, OlaLevelCriteria, Pdu_Plug, ChangeValidation, PDU_Rack, PlanningRecall, Problem_Supplier, Problem_Ticket, Problem_User, ProblemCost, Profile_Reminder, Profile_RSSFeed, Profile_User, ProfileRight, CommonITILActor, ProjectCost, ProjectTask, ProjectTask_Ticket, ProjectTaskTeam, ProjectTeam, RegisteredID, Reminder_User, Reservation, ReservationItem, RSSFeed_User, CommonITILCost, RuleAction, RuleCriteria, SavedSearch_Alert, SavedSearch_User, SLA, SlaLevelAction, SlaLevelCriteria, SoftwareVersion, Supplier_Ticket, Ticket_Ticket, CommonITILValidation, Ticket_User, TicketCost, TicketFollowup, TicketTemplateHiddenField, TicketTemplateMandatoryField, TicketTemplatePredefinedField, TicketValidation, UserEmail, Computer_Item, Computer_SoftwareLicense, Computer_SoftwareVersion, ComputerAntivirus, Cartridge, ComputerVirtualMachine, Consumable, Contact_Supplier, Contract_Item, Contract_Supplier, ContractCost, Document_Item, DropdownTranslation, Entity_KnowbaseItem, Entity_Reminder, CartridgeItem_PrinterModel, Entity_RSSFeed, FQDNLabel, Group_KnowbaseItem, Group_Problem, Group_Reminder, Group_RSSFeed, Group_Ticket, Group_User, Infocom, IPAddress, Certificate_Item, IPAddress_IPNetwork, IPNetmask, IPNetwork_Vlan, Item_DeviceBattery, Item_DeviceCase, Item_DeviceControl, Item_DeviceDrive, Item_DeviceFirmware, Item_DeviceGeneric, Item_DeviceGraphicCard, Change_Group, Item_DeviceHardDrive, Item_DeviceMemory, Item_DeviceMotherboard, Item_DeviceNetworkCard, Item_DevicePci, Item_DevicePowerSupply, Item_DeviceProcessor, Item_Devices, Item_DeviceSensor, Item_DeviceSimcard, Change_Item, Item_DeviceSoundCard, Item_Disk, Item_Enclosure, Item_OperatingSystem, Item_Problem, Item_Project, Item_Rack, Item_Ticket, Itil_Project, ITILFollowup, Change_Problem, ITILSolution, KnowbaseItem_Item, KnowbaseItem_Profile, KnowbaseItem_User, KnowbaseItemTranslation, LevelAgreement, Link_Itemtype, NetworkAlias, NetworkName, NetworkPort, Change_Supplier, NetworkPort_NetworkPort, NetworkPort_Vlan, NetworkPortAggregate, NetworkPortAlias, NetworkPortDialup, NetworkPortEthernet, NetworkPortFiberchannel, NetworkPortInstantiation, NetworkPortLocal, NetworkPortMigration, Change_Ticket, NetworkPortWifi, Notepad, Notification_NotificationTemplate, NotificationTarget, NotificationTargetCartridgeItem, NotificationTargetCertificate, NotificationTargetChange, NotificationTargetCommonITILObject, NotificationTargetConsumableItem, NotificationTargetContract
Abstract
Since: 0.84
Warning:

You have to care of calling CommonDBChild or CommonDBRelation methods if you override their methods (for instance: call parent::prepareInputForAdd($input) if you define prepareInputForAdd). You can find an example with UserEmail::prepareInputForAdd($input).


Located at commondbconnexity.class.php
Methods summary
public static string
# getSQLRequestToSearchForItem( string $itemtype, integer $items_id )

Return the SQL request to get all the connexities corresponding to $itemtype[$items_id] That is used by cleanDBOnItem : the only interesting field is static::getIndexName() But CommonDBRelation also use it to get more complex result

Return the SQL request to get all the connexities corresponding to $itemtype[$items_id] That is used by cleanDBOnItem : the only interesting field is static::getIndexName() But CommonDBRelation also use it to get more complex result

Deprecated

9.4

Parameters

$itemtype
the type of the item to look for
$items_id
the id of the item to look for

Returns

string
the SQL request of '' if it is not possible
public static array|null
# getSQLCriteriaToSearchForItem( string $itemtype, integer $items_id )

Return the SQL request to get all the connexities corresponding to $itemtype[$items_id] That is used by cleanDBOnItem : the only interesting field is static::getIndexName() But CommonDBRelation also use it to get more complex result

Return the SQL request to get all the connexities corresponding to $itemtype[$items_id] That is used by cleanDBOnItem : the only interesting field is static::getIndexName() But CommonDBRelation also use it to get more complex result

Parameters

$itemtype
the type of the item to look for
$items_id
the id of the item to look for

Returns

array|null

Since

9.4
public
# cleanDBonItemDelete( string $itemtype, integer $items_id )

Clean the Connecity Table when item of the relation is deleted To be call from the cleanDBonPurge of each Item class

Clean the Connecity Table when item of the relation is deleted To be call from the cleanDBonPurge of each Item class

Parameters

$itemtype
type of the item
$items_id
id of the item
public CommonDBTM|boolean
# getConnexityItem( string $itemtype, string $items_id, boolean $getFromDB = true, boolean $getEmpty = true, boolean $getFromDBOrEmpty = false )

get associated item (defined by $itemtype and $items_id)

get associated item (defined by $itemtype and $items_id)

Parameters

$itemtype
the name of the field of the type of the item to get
$items_id
the name of the field of the id of the item to get
$getFromDB
do we have to load the item from the DB ?
$getEmpty
else : do we have to load an empty item ?
$getFromDBOrEmpty
get from DB if possible, else, getEmpty

Returns

CommonDBTM|boolean
the item or false if we cannot load the item

See

CommonDBConnexity::getItemFromArray()
public static CommonDBTM|boolean
# getItemFromArray( string $itemtype, string $items_id, array $array, boolean $getFromDB = true, boolean $getEmpty = true, boolean $getFromDBOrEmpty = false )

get associated item (defined by $itemtype and $items_id)

get associated item (defined by $itemtype and $items_id)

Parameters

$itemtype
the name of the field of the type of the item to get
$items_id
the name of the field of the id of the item to get
$array
the array in we have to search ($input, $this->fields ...)
$getFromDB
do we have to load the item from the DB ?
$getEmpty
else : do we have to load an empty item ?
$getFromDBOrEmpty
get from DB if possible, else, getEmpty

Returns

CommonDBTM|boolean
the item or false if we cannot load the item
public true
# checkAttachedItemChangesAllowed( array $input, array $fields )

Factorization of prepareInputForUpdate for CommonDBRelation and CommonDBChild. Just check if we can change the item

Factorization of prepareInputForUpdate for CommonDBRelation and CommonDBChild. Just check if we can change the item

Parameters

$input
the new values for the current item
$fields
list of fields that define the attached items

Returns

true
if the attached item has changed, false if the attached items has not changed

Warning

if the update is not possible (right problem), then $input become false
public boolean
# tryEntityForwarding( )

Is auto entityForwarding needed ?

Is auto entityForwarding needed ?

Returns

boolean
public static boolean
# canConnexity( string $method, integer $item_right, string $itemtype, string $items_id )

Factorization of canCreate, canView, canUpate and canDelete. It checks the ability to create, view, update or delete the item if it is possible (ie : $itemtype != 'itemtype')

Factorization of canCreate, canView, canUpate and canDelete. It checks the ability to create, view, update or delete the item if it is possible (ie : $itemtype != 'itemtype')

The aim is that the rights are driven by the attached item : if we can do the action on the item, then we can do the action of the CommonDBChild or the CommonDBRelation. Thus, it is the inverse of CommonDBTM's behaviour, that, by default forbid any action (cf. CommonDBTM::canCreate and CommonDBTM::canView)

Parameters

$method
the method to check (canCreate, canView, canUpdate of canDelete)
$item_right
the right to check (DONT_CHECK_ITEM_RIGHTS, HAVE_VIEW_RIGHT_ON_ITEM ...)
$itemtype
the name of the field of the type of the item to get
$items_id
the name of the field of the id of the item to get

Returns

boolean
true if we have absolute right to create the current connexity

Warning

By default, if the action is possible regarding the attaching item, then it is possible on the CommonDBChild and the CommonDBRelation.


public true
# canConnexityItem( string $methodItem, string $methodNotItem, integer $item_right, string $itemtype, string $items_id, CommonDBTM & $item = null )

Factorization of canCreateItem, canViewItem, canUpateItem and canDeleteItem. It checks the ability to create, view, update or delete the item. If we cannot check the item (none is existing), then we can do the action of the current connexity

Factorization of canCreateItem, canViewItem, canUpateItem and canDeleteItem. It checks the ability to create, view, update or delete the item. If we cannot check the item (none is existing), then we can do the action of the current connexity

Parameters

$methodItem

the method to check (canCreateItem, canViewItem, canUpdateItem or canDeleteItem)

$methodNotItem
the method to check (canCreate, canView, canUpdate of canDelete)
$item_right
the right to check (DONT_CHECK_ITEM_RIGHTS, HAVE_VIEW_RIGHT_ON_ITEM ...)
$itemtype
the name of the field of the type of the item to get
$items_id
the name of the field of the id of the item to get
$item
$item the item concerned by the item

Returns

true
if we have absolute right to create the current connexity
public array
# getHistoryChangeWhenUpdateField( string $field )

Parameters

$field
the name of the field that has changed

Returns

array

as the third parameter of Log::history() method or false if we don't want to log for the given field

Since

0.84

Get the change values for history when only the fields of the CommonDBChild are updated


Warning

can be call as many time as fields are updated
public array
# getItemsForLog( string $itemtype, string $items_id )

Factorized method to search difference when updating a connexity : return both previous item and new item if both are different. Otherwise returns new items

Factorized method to search difference when updating a connexity : return both previous item and new item if both are different. Otherwise returns new items

Parameters

$itemtype
the name of the field of the type of the item to get
$items_id
the name of the field of the id of the item to get

Returns

array

containing "previous" (if exists) and "new". Beware that both can be equal to false

public static array
# getConnexityMassiveActionsSpecificities( )

Get all specificities of the current itemtype concerning the massive actions

Get all specificities of the current itemtype concerning the massive actions

Returns

array

of the specificities: 'reaffect' is it possible to reaffect the connexity (1 or 2 for CommonDBRelation) 'itemtypes' the types of the item in cas of reaffectation 'normalized' array('affect', 'unaffect') of arrays containing each action 'button_labels' array of the labels of the button indexed by the action name

Since

0.85
public static
# getMassiveActionsForItemtype( array & $actions, string $itemtype, boolean $is_deleted = 0, CommonDBTM $checkitem = null )

Parameters

$actions
array of the actions to update
$itemtype
the type of the item for which we want the actions
$is_deleted
(default 0)
$checkitem
(default NULL)

Returns


(update is set inside $actions)

Since

0.85

See

CommonDBTM::getMassiveActionsForItemtype()

Overrides

CommonDBTM::getMassiveActionsForItemtype()
public static boolean
# showMassiveActionsSubForm( MassiveAction $ma )

Parameters

$ma
the current massive action object

Returns

boolean
false if parameters displayed ?

Since

0.85

See

CommonDBTM::showMassiveActionsSubForm()

Overrides

CommonDBTM::showMassiveActionsSubForm()
public static array
# getConnexityInputForProcessingOfMassiveActions( string $action, CommonDBTM $item, array $ids, array $input )

Parameters

$action
the name of the action
$item
the item on which apply the massive action
$ids
the ids of the item on which apply the action
$input
the input provided by the form ($_POST, $_GET ...)

Returns

array
containing the elements

Since

0.85

Set based array for static::add or static::update in case of massive actions are doing something.


public static
# processMassiveActionsForOneItemtype( MassiveAction $ma, CommonDBTM $item, array $ids )

Parameters

$ma
the current massive action object
$item
the item on which apply the massive action
$ids
an array of the ids of the item on which apply the action

Returns


(direct submit to $ma object)

Since

0.85

See

CommonDBTM::processMassiveActionsForOneItemtype()

Overrides

CommonDBTM::processMassiveActionsForOneItemtype()
Methods inherited from CommonDBTM
__construct(), add(), addFiles(), addForwardEntity(), addMessageOnAddAction(), addMessageOnDeleteAction(), addMessageOnPurgeAction(), addMessageOnRestoreAction(), addMessageOnUpdateAction(), addNeededInfoToInput(), addToDB(), can(), canAddItem(), canCreate(), canCreateItem(), canDelete(), canDeleteItem(), canEdit(), canGlobal(), canMassiveAction(), canPurge(), canPurgeItem(), canUnrecurs(), canUpdate(), canUpdateItem(), canView(), canViewItem(), check(), checkEntity(), checkGlobal(), checkSpecificValues(), checkTemplateEntity(), checkUnicity(), cleanDBonMarkDeleted(), cleanDBonPurge(), cleanHistory(), cleanRelationData(), cleanRelationTable(), cleanTranslations(), clearSavedInput(), delete(), deleteByCriteria(), deleteChildrenAndRelationsFromDb(), deleteFromDB(), dropdown(), filterValues(), find(), forceTable(), forwardEntityInformations(), generateLinkContents(), getAutofillMark(), getComments(), getCompleteNameField(), getEmpty(), getEntityID(), getField(), getForbiddenStandardMassiveAction(), getForeignKeyField(), getForeignKeyFieldsOf(), getFromDB(), getFromDBByCrit(), getFromDBByRequest(), getFromIter(), getFromResultSet(), getID(), getIndexName(), getItemEntity(), getLink(), getLinkURL(), getLinkedItems(), getLinkedItemsCount(), getLogTypeID(), getName(), getNameField(), getNameID(), getOptions(), getPostAdditionalInfosForName(), getPreAdditionalInfosForName(), getRawCompleteName(), getRawName(), getRights(), getSearchOptionByField(), getSearchOptionIDByField(), getSearchOptionsToAdd(), getSpecificMassiveActions(), getSpecificValueToDisplay(), getSpecificValueToSelect(), getTable(), getTableField(), getTablesOf(), getUnallowedFieldsForUnicity(), getUnicityErrorMessage(), getUnicityFieldsToDisplayInErrorMessage(), getValueToDisplay(), getValueToSelect(), initForm(), isActive(), isDeleted(), isDynamic(), isEntityAssign(), isEntityForwardTo(), isField(), isNewID(), isNewItem(), isPrivate(), isRecursive(), isTemplate(), listTemplates(), maybeActive(), maybeDeleted(), maybeDynamic(), maybeLocated(), maybePrivate(), maybeRecursive(), maybeTemplate(), post_addItem(), post_deleteFromDB(), post_deleteItem(), post_getEmpty(), post_getFromDB(), post_purgeItem(), post_restoreItem(), post_updateItem(), pre_deleteItem(), pre_updateInDB(), prepareInputForAdd(), prepareInputForUpdate(), rawSearchOptions(), reset(), restore(), restoreInDB(), restoreInput(), saveInput(), searchOptions(), showDates(), showFormButtons(), showFormHeader(), unsetUndisclosedFields(), update(), updateInDB(), useDeletedToLockIfDynamic()
Methods inherited from CommonGLPI
addDefaultFormTab(), addStandardTab(), createTabEntry(), defineAllTabs(), defineTabs(), display(), displayStandardTab(), displayTabContentForItem(), getAdditionalMenuContent(), getAdditionalMenuLinks(), getAdditionalMenuOptions(), getAvailableDisplayOptions(), getDisplayOptions(), getDisplayOptionsLink(), getErrorMessage(), getForbiddenActionsForMenu(), getFormURL(), getFormURLWithID(), getMenuContent(), getMenuName(), getMenuShorcut(), getOtherTabs(), getSearchURL(), getTabNameForItem(), getTabsURL(), getType(), getTypeName(), isLayoutExcludedPage(), isLayoutWithMain(), redirectToList(), registerStandardTab(), showDebugInfo(), showDislayOptions(), showNavigationHeader(), showPrimaryForm(), showTabsContent(), updateDisplayOptions()
Constants summary
integer DONT_CHECK_ITEM_RIGHTS
# 1
integer HAVE_VIEW_RIGHT_ON_ITEM
# 2
integer HAVE_SAME_RIGHT_ON_ITEM
# 3
Properties summary
public static boolean $canDeleteOnItemClean
# true
public static boolean $disableAutoEntityForwarding
# false
Properties inherited from CommonDBTM
$additional_fields_for_dictionnary, $auto_message_on_action, $dohistory, $fields, $fkfield, $foreign_key_fields_of, $forward_entity_to, $get_item_to_display_tab, $history_blacklist, $no_form_page, $notable, $notificationqueueonaction, $plugins_forward_entity, $rightname, $searchopt, $tables_of, $taborientation, $undisclosedFields, $usenotepad
Properties inherited from CommonGLPI
$displaylist, $othertabs, $showdebug, $type
GLPI version 9.4.7 API API documentation generated by ApiGen