/ LJCPHPCodeDoc / LJCDataManagerLib / LJCDataManager / Columns


Parameters
$propertyNames - The included column property names.

Syntax

PHP
public function Columns(array $propertyNames = null): LJCDbColumns

Get the schema columns that match the property names.

Example

PHP
 // Get the column definitions that match the property names.
 private static function Columns(LJCDataManager $manager)
 {
   $propertyNames = [
     "ID",
     "Name",
   ];
 
   // See constructor for how to create $manager.
   $columns = $manager->Columns($propertyNames);
   $value = count($columns);
   $result = strval($value);
 
   // result:
   // 2
 
   $result = "";
   foreach ($columns as $column)
   {
     if (strlen(trim($result)) > 0)
     {
       $result .= ",";
     }
     $result .= $column->PropertyName;
   }
 
   // result:
   // ID,Name
 }

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