/ LJCPHPCodeDoc / LJCDataManagerLib / LJCDataManager / LoadSQL


Parameters
$keyColumns - The where clause key columns.
$propertyNames - The included column property names.
$joins - _ParamSummary_
$filter - _ParamSummary_

Returns

The Load SQL statement.

Syntax

PHP
public function LoadSQL(?LJCDbColumns $keyColumns = null
, ?array $propertyNames = null, ?LJCJoins $joins = null
, ?string $filter = null) : string

Creates the Load SQL.

Example

PHP
 // Creates the Load SQL.
 private static function LoadSQL(LJCDataManager $manager)
 {
   $nameValue = "NameValue";
   $methodName = "LoadSQL()";
 
   $data = new LJCDbColumns();
   $data->Add("Name", value: $nameValue);
   $affectedCount = $manager->Add($data);
 
   // Load with SQLLoad().
   // See constructor for how to create $manager.
   $keys = new LJCDbColumns();
   $keys->Add("Name", value: $nameValue);
   $result = $manager->LoadSQL($keys);
 
   // result:
   // $manager->SQL =
   // select
   //   TableName.ID,
   //   TableName.Name
   // from TableName
   // where TableName.Name = 'NameValue'
 
   $keys = new LJCDbColumns();
   $keys->Add("Name", value: $updateValue);
   $affectedCount = $manager->Delete($keys);
 }

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