« Back to Product

Documentation

IPS_GetLinkIDByName

Require: Symcon >= 2.1

 int IPS_GetLinkIDByName (string $LinkName, int $ParentID) 

Parameters

LinkName

Name of the link

ParentID

Object whose direct child objects are searched

Returns

ID of the found link, otherwise FALSE

Description

The function tries to determine the ID of the link called LinkName whose parent has the ID ParentID. The ID of the first found link whose name matches LinkName is used. If such a link was found, its ID is returned, otherwise FALSE.

Warning

Caution: Names in IP-Symcon can be chosen freely, so they are not unique. For this reason, the function can return a wrong ID.

Warning

This function generates a warning if the name was not found. Use the @ operator if you want to suppress this message. The exact functionality of this operator is explained in the PHP manual.

Example

$LinkID = @IPS_GetLinkIDByName("Linked rain sensing", $ParentID);
if ($LinkID === false)
    echo "Link not found!";
else
    echo "The link ID is: ". $LinkID;
Any questions?