PHP Class NetworkPort, glpi

Inheritance: extends CommonDBChild
Afficher le fichier Open project: glpi-project/glpi Class Usage Examples

Méthodes publiques

Свойство Type Description
$checkParentRights
$dohistory
$items_id
$itemtype From CommonDBChild
$rightname

Protected Properties

Свойство Type Description
$forward_entity_to

Méthodes publiques

Méthode Description
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

Method Details

cleanDBonPurge() public méthode

public cleanDBonPurge ( )

cloneItem() static public méthode

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 méthode

static public countForItem ( CommonDBTM $item )
$item CommonDBTM

defineTabs() public méthode

public defineTabs ( $options = [] )

displayTabContentForItem() static public méthode

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

getAvailableDisplayOptions() static public méthode

Get available display options array
static public getAvailableDisplayOptions ( ) : all
Résultat all the options

getConnexityMassiveActionsSpecificities() static public méthode

See also: CommonDBConnexity::getConnexityMassiveActionsSpecificities()

getContact() public méthode

Get port opposite port ID if linked item
public getContact ( $ID ) : ID
$ID networking port ID
Résultat ID of the NetworkPort found, false if not found

getForbiddenStandardMassiveAction() public méthode

getInstantiation() public méthode

\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
Résultat the instantiation object or false if the type of instantiation is not known

getNetworkPortInstantiations() static public méthode

\brief get the list of available network port type.
static public getNetworkPortInstantiations ( ) : array
Résultat array of available type of network ports

getNetworkPortInstantiationsWithNames() static public méthode

getPreAdditionalInfosForName() public méthode

See also: CommonDBTM::getPreAdditionalInfosForName

getSearchOptions() public méthode

public getSearchOptions ( )

getSearchOptionsToAdd() static public méthode

static public getSearchOptionsToAdd ( $itemtype )
$itemtype

getSpecificMassiveActions() public méthode

See also: CommonDBTM::getSpecificMassiveActions()
public getSpecificMassiveActions ( $checkitem = NULL )

getTabNameForItem() public méthode

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

getTypeName() static public méthode

static public getTypeName ( $nb )

post_addItem() public méthode

See also: CommonDBTM::post_addItem
public post_addItem ( )

post_updateItem() public méthode

See also: CommonDBTM::post_updateItem
public post_updateItem ( $history = 1 )

prepareInputForAdd() public méthode

See also: CommonDBTM::prepareInputForAdd
public prepareInputForAdd ( $input )

prepareInputForUpdate() public méthode

See also: CommonDBTM::prepareInputForUpdate
public prepareInputForUpdate ( $input )

resetConnections() public méthode

Delete All connection of the given network port
public resetConnections ( $ID ) : true
$ID ID of the port
Résultat true on success

showForItem() static public méthode

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

showForm() public méthode

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

splitInputForElements() public méthode

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.
See also: updateDependencies for the update
public splitInputForElements ( $input )
$input

switchInstantiationType() public méthode

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
Résultat false on error, true if the previous instantiation is not available (ie.: invalid instantiation type) or the object of the previous instantiation.

updateDependencies() public méthode

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.
See also: splitInputForElements() for preparing the input
public updateDependencies ( $history = true )
$history (default 1)

Property Details

$checkParentRights public_oe static_oe property

public static $checkParentRights

$dohistory public_oe property

public $dohistory

$forward_entity_to protected_oe static_oe property

protected static $forward_entity_to

$items_id public_oe static_oe property

public static $items_id

$itemtype public_oe static_oe property

From CommonDBChild
public static $itemtype

$rightname static_oe public_oe property

static public $rightname