/ LJCPHPCodeDoc / LJCCollectionLib / LJCCollectionBase / GetItem


Parameters
$key - The element key.
$throwError - Indicates if an error should be thrown if the key is not found.

Returns

The object with the matching key value.

Syntax

PHP
protected function GetItem($key, bool $throwError = true)

Get the item by Key value.

Example

PHP
$webCommonPath = "c:/inetpub/wwwroot/LJCPHPCommon";
require_once "$webCommonPath/LJCCollectionLib.php";
 
// Add to class that extends LJCCollectionBase
// Get the item by Key value.
public function Get($key)
{
  $retValue = $this->GetItem($key, $throwError);
  return $retValue;
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.