/ LJCPHPCodeDoc / LJCCollectionLib / LJCCollectionBase / GetValues


Returns

The indexed values array.

Syntax

PHP
public function GetValues(): array

Gets an indexed array of objects.

Example

PHP
 // The strongly typed collection class.
 class Names extends LJCCollectionBase
 {
   // Adds a string.
   // This method makes a string collection strongly typed.
   public function Add(string $text)
   {
     $retItem = $this->AddItem($text);
     return $retItem;
   }
 }
 
 // Gets an indexed array of objects.
 private static function GetValues()
 {
   $names = new Names();
   $names->Add("First");
   $names->Add("Second");
   $names->Add("Third");
   $values = $names->GetValues();
   $result = join(",", $values);
 
   // result:
   // First,Second,Third
 }

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