Parameters
$key - The element key.
Returns
True if the key already exists, otherwise false.
Syntax
| PHP |
|
public function HasKey($key) : bool
|
Indicates if a key already exists.
Example
| PHP |
include_once "LJCRoot.php";
$prefix = RelativePrefix();
include_once "$prefix/GenTextLib/LJCGenTextSectionLib.php";
$sections = new LJCSections();
$key = "SectionName";
if ($sections->HasKey($key))
{
throw new Exception("Key: {$key} already in use.");
}
else
{
$section = new LJCSection($key);
}
|
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.