/ LJCPHPCodeDoc / LJCCommonLib / LJC / HasItems


Parameters
$collection - The collection object.

Returns

true if the object is a collection and has items; otherwise false.

Syntax

PHP
public static function HasItems($collection): bool

Checks for collection items.

Example

PHP
 class Names extends LJCCollectionBase
 {
   public function Add(string $text)
   {
     $this->AddItem($text);
   }
 
   public string $Name;
 }
 
 // Checks for collection items.
 private static function HasItems()
 {
   $names = new Names();
   $names->Add("First");
 
   $value = LJC::HasItems($names);
   $result = $value ? "true" : "false";
 
   // result:
   // true
 }

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