-
Notifications
You must be signed in to change notification settings - Fork 54
Added field entityId to requests when validating unique fields #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,14 +14,24 @@ class UniqueEntity extends BaseUniqueEntity | |
| */ | ||
| public $entityName = null; | ||
|
|
||
| /** | ||
| * @var int | ||
| */ | ||
| public $entityId = null; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Store here whole entity object instead of fields. |
||
|
|
||
| /** | ||
| * @param BaseUniqueEntity $base | ||
| * @param string $entityName | ||
| * @param mixed $data | ||
| */ | ||
| public function __construct(BaseUniqueEntity $base, $entityName) | ||
| public function __construct(BaseUniqueEntity $base, $entityName, $data) | ||
|
||
| { | ||
| $this->entityName = $entityName; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| if (is_object($data) && method_exists($data, 'getId')) { | ||
| $this->entityId = $data->getId(); | ||
| } | ||
|
|
||
| foreach ($base as $prop => $value) { | ||
| $this->{$prop} = $value; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thinks better to pass all class with data.
$this->currentElement->getConfig()