<commit_before><?php

namespace UMRA\Bundle\MemberBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Email
 *
 * @ORM\Table(name="email",
 *            indexes={@ORM\Index(name="HouseholdID", columns={"HouseholdID"}),
 *                     @ORM\Index(name="PersonID", columns={"PersonID"}),
 *                     @ORM\Index(name="UserPreferred", columns={"preferred", "PersonID"})})
 * @UniqueEntity(fields={"email"}, message="The specified email already exists.")
 * @UniqueEntity(fields={"preferred", "person"}, message="Cannot have more than one preferred email")
 * @ORM\Entity
 */
class Email
{
    /**
     * @var string
     *
     * @Assert\Choice(choices = {"personal", "shared", "work", "other"}, message = "Must be personal, shared, work, or other")
     * @ORM\Column(name="Type", type="string", length=10, nullable=false)
     */
    private $type;

    /**
     * @var string
     *
     * @Assert\Email()
     * @ORM\Column(name="Email", type="string", length=60, nullable=false, unique=True)
     */
    private $email;

    /**
     * @var boolean
     *
     * @ORM\Column(name="Preferred", type="boolean", nullable=True)<commit_msg>Enforce 'one preferred email per Person' at the database level.<commit_after><?php

namespace UMRA\Bundle\MemberBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Email
 *
 * @ORM\Table(name="email",
 *            indexes={@ORM\Index(name="HouseholdID", columns={"HouseholdID"}),
 *                     @ORM\Index(name="PersonID", columns={"PersonID"})},
 *            uniqueConstraints={@ORM\UniqueConstraint(name="OnePreferredPerUser", columns={"preferred", "PersonID"})}
 * )
 * @UniqueEntity(fields={"email"}, message="The specified email already exists.")
 * @UniqueEntity(fields={"preferred", "person"}, message="Cannot have more than one preferred email")
 * @ORM\Entity
 */
class Email
{
    /**
     * @var string
     *
     * @Assert\Choice(choices = {"personal", "shared", "work", "other"}, message = "Must be personal, shared, work, or other")
     * @ORM\Column(name="Type", type="string", length=10, nullable=false)
     */
    private $type;

    /**
     * @var string
     *
     * @Assert\Email()
     * @ORM\Column(name="Email", type="string", length=60, nullable=false, unique=True)
     */
    private $email;

    /**
     * @var boolean
     *
     * @ORM\Column(name="Preferred", type="boolean", nullable=True)
{'fraction_non_alphanumeric': 0.17475360121304018, 'fraction_numerical': 0.003032600454890068, 'mean_word_length': 3.557858376511226, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4255094', 'n_tokens_mistral': 815, 'n_tokens_neox': 791, 'n_words': 160}