<commit_before><?php

namespace Victoire\Bundle\BlogBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
use Victoire\Bundle\BusinessEntityPageBundle\Entity\BusinessEntityPagePattern;
use Victoire\Bundle\CoreBundle\Annotations as VIC;
use Victoire\Bundle\CoreBundle\Entity\Traits\BusinessEntityTrait;
use Victoire\Bundle\MediaBundle\Entity\Media;

/**
 * @ORM\Entity(repositoryClass="Victoire\Bundle\BlogBundle\Repository\ArticleRepository"))
 * @ORM\Table("vic_article")
 * @VIC\BusinessEntity({"Force", "Redactor", "Listing", "BlogArticles", "Title", "CKEditor", "Text", "UnderlineTitle", "Cover", "Image", "Authorship", "ArticleList"})
 * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
 */
class Article
{
    use BusinessEntityTrait;
    use TimestampableEntity;

    const DRAFT       = "draft";
    const PUBLISHED   = "published";
    const UNPUBLISHED = "unpublished";
    const SCHEDULED   = "scheduled";

    /**
     * @VIC\BusinessProperty("businessParameter")
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * Title is inherited from Page, just add the BusinessProperty annotation
     *
     * @ORM\Column(name="name", type="string", length=255)
     * @Assert\NotBlank()
     * @VIC\BusinessProperty({"textable", "businessParameter"})
     */
    private $name;

    /**
     * @ORM\Column(name="slug", type="string", length=255)
     * @Gedmo\Slug(fields={"name"}, updatable=false, unique=false)
     * @VIC\BusinessProperty("businessParameter")
     */
    private $slug;

    /**
     * Description is inherited from Page, just add the BusinessProperty annotation
     * @ORM\Column(name="description", type="text", nullable=true)
     * @VIC\BusinessProperty("textable")
     */
    private $description;

    /**
     * @ORM\Column(name="status", type="string", nullable=false)
     */
    protected $status;

    /**
     * Categories of the article
     * @ORM\ManyToOne(targetEntity="Category", inversedBy="articles")
     * @ORM\JoinColumn(onDelete="SET NULL")
     */
    private $category;

    /**
     * @var datetime $publishedAt
     *
     * @ORM\Column(name="publishedAt", type="datetime", nullable=true)
     * @VIC\BusinessProperty("dateable")
     * @VIC\BusinessProperty("textable")
     */
    private $publishedAt;

    /**
     * This relation is dynamically added by ArticleSubscriber
     * The property is needed here
     */
    private $author;

    /**
     * Tags of the article
     * @ORM\ManyToMany(targetEntity="Tag", inversedBy="articles")
     * @ORM\JoinTable(name="vic_article_tags")
     * @Assert\Valid()
     */
    private $tags;

    /**
     * @ORM\ManyToOne(targetEntity="\Victoire\Bundle\BlogBundle\Entity\Blog", inversedBy="articles", cascade={"persist"})
     * @ORM\JoinColumn(name="blog_id", referencedColumnName="id", onDelete="CASCADE")
     */
    private $blog;

    /**
     * @var BusinessEntityPagePattern
     * @ORM\ManyToOne(targetEntity="\Victoire\Bundle\BusinessEntityPageBundle\Entity\BusinessEntityPagePattern")<commit_msg>set article publish on draft on création<commit_after><?php

namespace Victoire\Bundle\BlogBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
use Victoire\Bundle\BusinessEntityPageBundle\Entity\BusinessEntityPagePattern;
use Victoire\Bundle\CoreBundle\Annotations as VIC;
use Victoire\Bundle\CoreBundle\Entity\Traits\BusinessEntityTrait;
use Victoire\Bundle\MediaBundle\Entity\Media;

/**
 * @ORM\Entity(repositoryClass="Victoire\Bundle\BlogBundle\Repository\ArticleRepository"))
 * @ORM\Table("vic_article")
 * @VIC\BusinessEntity({"Force", "Redactor", "Listing", "BlogArticles", "Title", "CKEditor", "Text", "UnderlineTitle", "Cover", "Image", "Authorship", "ArticleList"})
 * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
 */
class Article
{
    use BusinessEntityTrait;
    use TimestampableEntity;

    const DRAFT       = "draft";
    const PUBLISHED   = "published";
    const UNPUBLISHED = "unpublished";
    const SCHEDULED   = "scheduled";

    /**
     * @VIC\BusinessProperty("businessParameter")
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * Title is inherited from Page, just add the BusinessProperty annotation
     *
     * @ORM\Column(name="name", type="string", length=255)
     * @Assert\NotBlank()
     * @VIC\BusinessProperty({"textable", "businessParameter"})
     */
    private $name;

    /**
     * @ORM\Column(name="slug", type="string", length=255)
     * @Gedmo\Slug(fields={"name"}, updatable=false, unique=false)
     * @VIC\BusinessProperty("businessParameter")
     */
    private $slug;

    /**
     * Description is inherited from Page, just add the BusinessProperty annotation
     * @ORM\Column(name="description", type="text", nullable=true)
     * @VIC\BusinessProperty("textable")
     */
    private $description;

    /**
     * @ORM\Column(name="status", type="string", nullable=false)
     */
    protected $status;

    /**
     * Categories of the article
     * @ORM\ManyToOne(targetEntity="Category", inversedBy="articles")
     * @ORM\JoinColumn(onDelete="SET NULL")
     */
    private $category;

    /**
     * @var datetime $publishedAt
     *
     * @ORM\Column(name="publishedAt", type="datetime", nullable=true)
     * @VIC\BusinessProperty("dateable")
     * @VIC\BusinessProperty("textable")
     */
    private $publishedAt = self::DRAFT;

    /**
     * This relation is dynamically added by ArticleSubscriber
     * The property is needed here
     */
    private $author;

    /**
     * Tags of the article
     * @ORM\ManyToMany(targetEntity="Tag", inversedBy="articles")
     * @ORM\JoinTable(name="vic_article_tags")
     * @Assert\Valid()
     */
    private $tags;

    /**
     * @ORM\ManyToOne(targetEntity="\Victoire\Bundle\BlogBundle\Entity\Blog", inversedBy="articles", cascade={"persist"})
     * @ORM\JoinColumn(name="blog_id", referencedColumnName="id", onDelete="CASCADE")
     */
    private $blog;

    /**
     * @var BusinessEntityPagePattern
     * @ORM\ManyToOne(targetEntity="\Victoire\Bundle\BusinessEntityPageBundle\Entity\BusinessEntityPagePattern")
{'fraction_non_alphanumeric': 0.14787120402868914, 'fraction_numerical': 0.0018312223409125592, 'mean_word_length': 3.732129963898917, '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': '3206036', 'n_tokens_mistral': 2104, 'n_tokens_neox': 1988, 'n_words': 348}