PHP Класс NetworkPort, glpi

Наследование: extends CommonDBChild
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$checkParentRights
$dohistory
$items_id
$itemtype From CommonDBChild
$rightname

Защищенные свойства (Protected)

Свойство Тип Описание
$forward_entity_to

Открытые методы

Метод Описание
cleanDBonPurge ( )
cloneItem ( $itemtype, $old_items_id, $new_items_id ) Clone the current NetworkPort when the item is clone
countForItem ( CommonDBTM $item )
defineTabs ( $options = [] )
displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
getAvailableDisplayOptions ( ) : all Get available display options array
getConnexityMassiveActionsSpecificities ( )
getContact ( $ID ) : ID Get port opposite port ID if linked item
getForbiddenStandardMassiveAction ( )
getInstantiation ( ) : the \brief get the instantiation of the current NetworkPort The instantiation rely on the instantiation_type field and the id of the NetworkPort. If the network port exists, but not its instantiation, then, the instantiation will be empty.
getNetworkPortInstantiations ( ) : array \brief get the list of available network port type.
getNetworkPortInstantiationsWithNames ( )
getPreAdditionalInfosForName ( )
getSearchOptions ( )
getSearchOptionsToAdd ( $itemtype )
getSpecificMassiveActions ( $checkitem = NULL )
getTabNameForItem ( CommonGLPI $item, $withtemplate )
getTypeName ( $nb )
post_addItem ( )
post_updateItem ( $history = 1 )
prepareInputForAdd ( $input )
prepareInputForUpdate ( $input )
resetConnections ( $ID ) : true Delete All connection of the given network port
showForItem ( CommonDBTM $item, $withtemplate = '' ) Show ports for an item
showForm ( $ID, $options = [] )
splitInputForElements ( $input ) \brief split input fields when validating a port
switchInstantiationType ( $new_instantiation_type ) : false Change the instantion type of a NetworkPort : check validity of the new type of instantiation and that it is not equal to current ones. Update the NetworkPort and delete the previous instantiation. It is up to the caller to create the new instantiation !
updateDependencies ( $history = true ) \brief update all related elements after adding or updating an element

Описание методов

cleanDBonPurge() публичный Метод

public cleanDBonPurge ( )

cloneItem() статический публичный Метод

Clone the current NetworkPort when the item is clone
static public cloneItem ( $itemtype, $old_items_id, $new_items_id )
$itemtype the type of the item that was clone
$old_items_id the id of the item that was clone
$new_items_id the id of the item after beeing cloned

countForItem() статический публичный Метод

static public countForItem ( CommonDBTM $item )
$item CommonDBTM

defineTabs() публичный Метод

public defineTabs ( $options = [] )

displayTabContentForItem() статический публичный Метод

static public displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
$item CommonGLPI

getAvailableDisplayOptions() статический публичный Метод

Get available display options array
static public getAvailableDisplayOptions ( ) : all
Результат all the options

getConnexityMassiveActionsSpecificities() статический публичный Метод

См. также: CommonDBConnexity::getConnexityMassiveActionsSpecificities()

getContact() публичный Метод

Get port opposite port ID if linked item
public getContact ( $ID ) : ID
$ID networking port ID
Результат ID of the NetworkPort found, false if not found

getForbiddenStandardMassiveAction() публичный Метод

getInstantiation() публичный Метод

\brief get the instantiation of the current NetworkPort The instantiation rely on the instantiation_type field and the id of the NetworkPort. If the network port exists, but not its instantiation, then, the instantiation will be empty.
public getInstantiation ( ) : the
Результат the instantiation object or false if the type of instantiation is not known

getNetworkPortInstantiations() статический публичный Метод

\brief get the list of available network port type.
static public getNetworkPortInstantiations ( ) : array
Результат array of available type of network ports

getNetworkPortInstantiationsWithNames() статический публичный Метод

getPreAdditionalInfosForName() публичный Метод

См. также: CommonDBTM::getPreAdditionalInfosForName

getSearchOptions() публичный Метод

public getSearchOptions ( )

getSearchOptionsToAdd() статический публичный Метод

static public getSearchOptionsToAdd ( $itemtype )
$itemtype

getSpecificMassiveActions() публичный Метод

См. также: CommonDBTM::getSpecificMassiveActions()
public getSpecificMassiveActions ( $checkitem = NULL )

getTabNameForItem() публичный Метод

public getTabNameForItem ( CommonGLPI $item, $withtemplate )
$item CommonGLPI

getTypeName() статический публичный Метод

static public getTypeName ( $nb )

post_addItem() публичный Метод

См. также: CommonDBTM::post_addItem
public post_addItem ( )

post_updateItem() публичный Метод

См. также: CommonDBTM::post_updateItem
public post_updateItem ( $history = 1 )

prepareInputForAdd() публичный Метод

См. также: CommonDBTM::prepareInputForAdd
public prepareInputForAdd ( $input )

prepareInputForUpdate() публичный Метод

См. также: CommonDBTM::prepareInputForUpdate
public prepareInputForUpdate ( $input )

resetConnections() публичный Метод

Delete All connection of the given network port
public resetConnections ( $ID ) : true
$ID ID of the port
Результат true on success

showForItem() статический публичный Метод

Show ports for an item
static public showForItem ( CommonDBTM $item, $withtemplate = '' )
$item CommonDBTM CommonDBTM object
$withtemplate integer withtemplate param (default '')

showForm() публичный Метод

public showForm ( $ID, $options = [] )

splitInputForElements() публичный Метод

The form of the NetworkPort can contain the details of the NetworkPortInstantiation as well as NetworkName elements (if no more than one name is attached to this port). Feilds from both NetworkPortInstantiation and NetworkName must not be process by the NetworkPort::add or NetworkPort::update. But they must be kept for adding or updating these elements. This is done after creating or updating the current port. Otherwise, its ID may not be known (in case of new port). To keep the unused fields, we check each field key. If it is owned by NetworkPort (ie : exists inside the $this->fields array), then they remain inside $input. If they are prefix by "Networkname_", then they are added to $this->input_for_NetworkName. Else, they are for the instantiation and added to $this->input_for_instantiation. This method must be call before NetworkPort::add or NetworkPort::update in case of NetworkPort form. Otherwise, the entry of the database may contain wrong values.
См. также: updateDependencies for the update
public splitInputForElements ( $input )
$input

switchInstantiationType() публичный Метод

Change the instantion type of a NetworkPort : check validity of the new type of instantiation and that it is not equal to current ones. Update the NetworkPort and delete the previous instantiation. It is up to the caller to create the new instantiation !
public switchInstantiationType ( $new_instantiation_type ) : false
$new_instantiation_type the name of the new instaniation type
Результат false on error, true if the previous instantiation is not available (ie.: invalid instantiation type) or the object of the previous instantiation.

updateDependencies() публичный Метод

splitInputForElements() prepare the data for adding or updating NetworkPortInstantiation and NetworkName. This method will update NetworkPortInstantiation and NetworkName. I must be call after NetworkPort::add or NetworkPort::update otherwise, the networkport ID will not be known and the dependencies won't have a valid items_id field.
См. также: splitInputForElements() for preparing the input
public updateDependencies ( $history = true )
$history (default 1)

Описание свойств

$checkParentRights публичное статическое свойство

public static $checkParentRights

$dohistory публичное свойство

public $dohistory

$forward_entity_to защищенное статическое свойство

protected static $forward_entity_to

$items_id публичное статическое свойство

public static $items_id

$itemtype публичное статическое свойство

From CommonDBChild
public static $itemtype

$rightname статическое публичное свойство

static public $rightname