Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DoctrineBridge][Validator] Allow validating every class against unique entity constraint #38662

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions src/Symfony/Bridge/Doctrine/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

7.1
---

* Allow validating every class against `UniqueEntity` constraint

7.0
---

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bridge\Doctrine\Tests\Fixtures;

class CreateDoubleNameEntity
{
public $primaryName;
public $secondaryName;

public function __construct($primaryName, $secondaryName)
{
$this->primaryName = $primaryName;
$this->secondaryName = $secondaryName;
}
}
17 changes: 17 additions & 0 deletions src/Symfony/Bridge/Doctrine/Tests/Fixtures/Dto.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bridge\Doctrine\Tests\Fixtures;

class Dto
{
public string $foo;
}
22 changes: 22 additions & 0 deletions src/Symfony/Bridge/Doctrine/Tests/Fixtures/HireAnEmployee.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bridge\Doctrine\Tests\Fixtures;

class HireAnEmployee
{
public $name;

public function __construct($name)
{
$this->name = $name;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bridge\Doctrine\Tests\Fixtures;

class UpdateCompositeIntIdEntity
{
public $id1;
public $id2;
public $name;

public function __construct($id1, $id2, $name)
{
$this->id1 = $id1;
$this->id2 = $id2;
$this->name = $name;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bridge\Doctrine\Tests\Fixtures;

class UpdateCompositeObjectNoToStringIdEntity
{
/**
* @var SingleIntIdNoToStringEntity
*/
protected $object1;

/**
* @var SingleIntIdNoToStringEntity
*/
protected $object2;

public $name;

public function __construct(SingleIntIdNoToStringEntity $object1, SingleIntIdNoToStringEntity $object2, $name)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I should use Constructor Property Promotion here.

{
$this->object1 = $object1;
$this->object2 = $object2;
$this->name = $name;
}

public function getObject1(): SingleIntIdNoToStringEntity
{
return $this->object1;
}

public function getObject2(): SingleIntIdNoToStringEntity
{
return $this->object2;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bridge\Doctrine\Tests\Fixtures;

class UpdateEmployeeProfile
{
public $id;
public $name;

public function __construct($id, $name)
{
$this->id = $id;
$this->name = $name;
}
}
Loading