<commit_before><?php

declare(strict_types=1);
// @author <NAME> <<EMAIL>>

namespace AppBundle\Entity;

use AppBundle\Url\Info;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity(repositoryClass="AppBundle\Repository\EntryRepository")
 * @ORM\Table(name="entry")
 * @UniqueEntity(fields={"url", "user"}, message="url already in database")
 */
class Entry extends AbstractEntity
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=500)
     * @Assert\Url
     */
    private $url;

    /**
     * @ORM\Column(type="string")
     * @Assert\NotBlank
     */
    private $title;

    /**
     * the category, any of the self::CATEGORY_* constants.
     *
     * @ORM\Column(type="string")
     */
    private $category = Category::READ;

    /**
     * @ORM\Column(type="boolean")
     */
    private $pending = true;

    /**
     * @ORM\ManyToMany(targetEntity="Tag", cascade={"persist"}, inversedBy="entries")
     * @ORM\JoinTable(name="entry_has_tag")
     */
    private $tags;

    /**
     * @ORM\OneToMany(targetEntity="Visit", mappedBy="entry", cascade={"all"})
     */<commit_msg>add validation for title field to prevent sql strict mode error<commit_after><?php

declare(strict_types=1);
// @author <NAME> <<EMAIL>>

namespace AppBundle\Entity;

use AppBundle\Url\Info;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity(repositoryClass="AppBundle\Repository\EntryRepository")
 * @ORM\Table(name="entry")
 * @UniqueEntity(fields={"url", "user"}, message="url already in database")
 */
class Entry extends AbstractEntity
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=500)
     * @Assert\Url
     */
    private $url;

    /**
     * @ORM\Column(type="string")
     * @Assert\NotBlank
     * @Assert\Length(max=255)
     */
    private $title;

    /**
     * the category, any of the self::CATEGORY_* constants.
     *
     * @ORM\Column(type="string")
     */
    private $category = Category::READ;

    /**
     * @ORM\Column(type="boolean")
     */
    private $pending = true;

    /**
     * @ORM\ManyToMany(targetEntity="Tag", cascade={"persist"}, inversedBy="entries")
     * @ORM\JoinTable(name="entry_has_tag")
     */
    private $tags;

    /**
     * @ORM\OneToMany(targetEntity="Visit", mappedBy="entry", cascade={"all"})
     */
{'fraction_non_alphanumeric': 0.17070524412296564, 'fraction_numerical': 0.003978300180831827, 'mean_word_length': 3.12220566318927, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '6019973', 'n_tokens_mistral': 915, 'n_tokens_neox': 880, 'n_words': 153}