Skip to content

Commit

Permalink
LJCPHPCommon Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ljlclark committed Apr 14, 2024
1 parent 1ecf22b commit 5790c4b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 20 deletions.
20 changes: 7 additions & 13 deletions LJCPHPCommon/LJCCollectionLib.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class LJCCollectionBase implements IteratorAggregate, Countable

// Adds an object and key value.
/// <include path='items/AddItem/*' file='Doc/LJCCollectionBase.xml'/>
protected function Add($item, $key = null)
protected function AddItem($item, $key = null)
{
$retValue = $item;

Expand All @@ -36,16 +36,9 @@ protected function Add($item, $key = null)
return $retValue;
}

// Adds an object and key value.
// Obsolete: Use Add().
protected function AddItem($item, $key = null)
{
return Add($item, $key);
}

// Remove the item by Key value.
/// <include path='items/Remove/*' file='Doc/LJCCollectionBase.xml'/>
public function Delete($key, bool $throwError = true) : void
public function DeleteItem($key, bool $throwError = true) : void
{
$success = true;
if (false == $this->HasKey($key))
Expand All @@ -64,9 +57,10 @@ public function Delete($key, bool $throwError = true) : void

// Get the item by Key value.
/// <include path='items/GetItem/*' file='Doc/LJCCollectionBase.xml'/>
// Obsolete: Use RetrieveItem().
protected function GetItem($key, bool $throwError = true)
{
return Retrieve($key, $throwError);
return RetrieveItem($key, $throwError);
}

/// <summary>Gets an indexed array of keys.</summary>
Expand All @@ -92,15 +86,15 @@ public function HasKey($key) : bool
}

// Remove the item by Key value.
// Obsolete: Use Delete().
// Obsolete: Use DeleteItem().
public function Remove($key, bool $throwError = true) : void
{
Delete($key, $throwError);
DeleteItem($key, $throwError);
}

// Get the item by Key value.
/// <include path='items/GetItem/*' file='Doc/LJCCollectionBase.xml'/>
protected function Retrieve($key, bool $throwError = true)
protected function RetrieveItem($key, bool $throwError = true)
{
$retValue = null;

Expand Down
35 changes: 28 additions & 7 deletions LJCPHPCommon/LJCDBAccessLib.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,10 @@ public function Clone() : self
}

// Get the item by Key value.
/// <include path='items/Get/*' file='Doc/LJCDbColumns.xml'/>
// Obsolete: Use Retrieve().
public function Get($key, bool $throwError = true) : ?LJCDbColumn
{
$retValue = $this->GetItem($key, $throwError);
return $retValue;
return $this->Retrieve($key, $throwError);
}

// Get the column definitions that match the property names.
Expand Down Expand Up @@ -426,6 +425,14 @@ public function MapNames(string $columnName, ?string $propertyName = null
}
}

// Get the item by Key value.
/// <include path='items/Get/*' file='Doc/LJCDbColumns.xml'/>
public function Retrieve($key, bool $throwError = true) : ?LJCDbColumn
{
$retValue = $this->RetrieveItem($key, $throwError);
return $retValue;
}

// Sets the Where Clause operators.
/// <include path='items/SetWhereOperators/*' file='Doc/LJCDbColumns.xml'/>
public function SetWhereOperators($key, string $compareOperator
Expand Down Expand Up @@ -538,11 +545,18 @@ public function Clone() : self
return $retValue;
}

// Get the item by Key value.
// Obsolete: Use Retrieve().
public function Get($key, bool $throwError = true) : ?LJCJoin
{
return $this->Retrieve($key, $throwError);
}

/// <summary>Get the item by Key value.</summary>
/// <include path='items/Get/*' file='Doc/LJCJoins.xml'/>
public function Get($key, bool $throwError = true) : ?LJCJoin
public function Retrieve($key, bool $throwError = true) : ?LJCJoin
{
$retValue = $this->GetItem($key, $throwError);
$retValue = $this->RetrieveItem($key, $throwError);
return $retValue;
}
}
Expand Down Expand Up @@ -641,11 +655,18 @@ public function Clone() : self
return $retValue;
}

// Get the item by Key value.
// Obsolete: Use Retrieve().
public function Get($key, bool $throwError = true) : ?LJCJoinOn
{
return $this.Retrieve($key,$throwError);
}

/// <summary>Get the item by Key value.</summary>
/// <include path='items/Get/*' file='Doc/LJCJoinOns.xml'/>
public function Get($key, bool $throwError = true) : ?LJCJoinOn
public function Retrieve($key, bool $throwError = true) : ?LJCJoinOn
{
$retValue = $this->GetItem($key, $throwError);
$retValue = $this->RetrieveItem($key, $throwError);
return $retValue;
}
}
Expand Down

0 comments on commit 5790c4b

Please sign in to comment.