Skip to content

Commit fc9747a

Browse files
committed
refactor: Adiciona propriedades entityClass e identifier na exceção EntityNotFoundException e implementa métodos de acesso
1 parent eebfe94 commit fc9747a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Exceptions/EntityNotFoundException.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,27 @@
44

55
class EntityNotFoundException extends CycleORMException
66
{
7+
private string $entityClass;
8+
private int|string $identifier;
9+
710
public function __construct(
811
string $entityClass,
912
int|string $identifier,
1013
?\Throwable $previous = null
1114
) {
15+
$this->entityClass = $entityClass;
16+
$this->identifier = $identifier;
1217
$message = "Entity {$entityClass} with identifier {$identifier} not found";
1318
parent::__construct($message, 0, $previous);
1419
}
20+
21+
public function getEntityClass(): string
22+
{
23+
return $this->entityClass;
24+
}
25+
26+
public function getIdentifier(): int|string
27+
{
28+
return $this->identifier;
29+
}
1530
}

0 commit comments

Comments
 (0)