Skip to content
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

fix: UniqueEntity::$service is considered final #777

Merged
merged 5 commits into from
Aug 24, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions Validator/Constraints/Unique.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,35 @@
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
class Unique extends UniqueEntity
{
/** @var string */
public $service = 'doctrine_odm.mongodb.unique';
/**
* @param array|string $fields The combination of fields that must contain unique values or a set of options
* @param bool|array|string $ignoreNull The combination of fields that ignore null values
*/
public function __construct(
$fields,
string $message = null,
string $service = null,
string $em = null,
string $entityClass = null,
string $repositoryMethod = null,
string $errorPath = null,
bool|string|array $ignoreNull = null,
array $groups = null,
$payload = null,
array $options = []
) {
parent::__construct(
$fields,
$message,
'doctrine_odm.mongodb.unique',
divine marked this conversation as resolved.
Show resolved Hide resolved
$em,
$entityClass,
$repositoryMethod,
$errorPath,
$ignoreNull,
$groups,
$payload,
$options
);
}
}