1.0.0 Alpha Release #59
1 changed files with 5 additions and 2 deletions
|
@ -74,15 +74,18 @@
|
|||
*/
|
||||
public function deleteEntry(string $name): bool
|
||||
{
|
||||
foreach($this->Entries as $entry)
|
||||
// Find the entry
|
||||
foreach($this->Entries as $index => $entry)
|
||||
{
|
||||
if($entry->getName() === $name)
|
||||
{
|
||||
$this->Entries = array_diff($this->Entries, [$entry]);
|
||||
// Remove the entry
|
||||
unset($this->Entries[$index]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Entry not found
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue