PHP code example of emericanec / symfony-unique-entity-validator
1. Go to this page and download the library: Download emericanec/symfony-unique-entity-validator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
emericanec / symfony-unique-entity-validator example snippets
use Emericanec\UniqueEntity;
/**
* @UniqueEntity(
* entityClass="App\Entity\User",
* fields={"email"}
* )
*/
class RegistrationForm
{
protected string $email;
public function getEmail(): string
{
return $this->email;
}
public function setEmail(string $email): void
{
$this->email = $email;
}
}