/ LJCPHPCodeDoc / LJCDataManagerLib / LJCDataManager / Load


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

Returns

An array of data records.

Syntax

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

Loads the records for the provided values.

Remarks

Loads records from the database.

The $keyColumns collection parameter contains the data for the where clause.

The optional $propertyNames array parameter contains the names of the properties that will be retrieved. All columns are retrieved if it is null.

Example

PHP
 $webCommonPath = "c:/inetpub/wwwroot/LJCPHPCommon";
 require_once "$webCommonPath/LJCDataManagerLib.php";
 require_once "$webCommonPath/LJCDBAccessLib.php";
 
 // See constructor for how to create $connectionValues.
 $tableName = "TableName";
 $manager = new LJCDataManager($connectionValues, $tableName);
 
 $propertyNames = [];
 $propertyNames[] = "ID";
 $propertyNames[] = "Name";
 $affectedCount = $manager->Load(null, $propertyNames);
 
 // $manager->SQL =
 // select
 //   TableName.ID,
 //   TableName.Name
 // from TableName;

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