| PHP |
|---|
|
public function Retrieve(LJCDbColumns $keyColumns , array $propertyNames = null, LJCJoins $joins = null): ?array |
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.| PHP |
|---|
// Retrieves the record for the provided values.
private static function Retrieve(LJCDataManager $manager)
{
$nameValue = "NameValue";
$methodName = "Retrieve()";
$data = new LJCDbColumns();
$data->Add("Name", value: $nameValue);
$affectedCount = $manager->Add($data);
// Retrieve the test data.
// See constructor for how to create $manager.
$keys = new LJCDbColumns();
$keys->Add("Name", value: $nameValue);
$row = $manager->Retrieve($keys);
if (null == $row
|| !is_array($row)
|| 0 == count($row))
{
echo($manager->SQL);
echo("\r\n{$methodName} No data retrieved.");
}
// $manager->SQL =
// select
// TableName.ID,
// TableName.Name
// from TableName
// where TableName.Name = 'NameValue'
$keys = new LJCDbColumns();
$keys->Add("Name", value: $nameValue);
$affectedCount = $manager->Delete($keys);
}
|