<commit_before><?php

namespace Kisphp\OrderBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Kisphp\Entity\KisphpEntityInterface;

/**
 * @ORM\Entity
 * @ORM\Table(name="sales_items", options={"collate": "utf8_general_ci", "charset": "utf8"})
 * @ORM\HasLifecycleCallbacks()
 */
class SalesItemEntity implements KisphpEntityInterface, SalesItemEntityInterface
{
    /**
     * @var string
     *
     * @ORM\Column(type="integer", options={"unsigned": true})
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var string
     *
     * @ORM\Column(type="integer", options={"unsigned": true})
     */
    protected $id_order;

    /**
     * @var SalesEntityInterface
     *
     * @ORM\ManyToOne(targetEntity="SalesEntity", inversedBy="items")
     * @ORM\JoinColumn(name="id_order", referencedColumnName="id")
     */
    protected $order;

    /**
     * @var int
     *
     * @ORM\Column(type="integer")
     */
    protected $id_product;

    /**
     * @var int
     *
     * @ORM\Column(type="integer")
     */
    protected $id_category;

    /**
     * @var int
     *
     * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
     */
    protected $quantity = 0;

    /**
     * @var \DateTime
     * @ORM\Column(type="datetime")
     */
    protected $registered;

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_sku;

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_code;

    /**
     * @var int
     *
     * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
     */
    protected $product_price;

    /**
     * @var int
     *
     * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
     */
    protected $product_price_old;

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_currency;

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_title;

    /**
     * @var string
     *
     * @ORM\Column(type="text", nullable=true)
     */
    protected $product_description;

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_image_directory;

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_image_filename;

    /**
     * @ORM\PrePersist()
     */
    public function updateModifiedDatetime()
    {
        if ($this->registered === null) {
            $this->setRegistered(new \DateTime());
        }
    }

    /**
     * @return \DateTime
     */
    public function getRegistered()
    {
        return $this->registered;
    }

    /**<commit_msg>fixed add products to cart that has no image<commit_after><?php

namespace Kisphp\OrderBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Kisphp\Entity\KisphpEntityInterface;

/**
 * @ORM\Entity
 * @ORM\Table(name="sales_items", options={"collate": "utf8_general_ci", "charset": "utf8"})
 * @ORM\HasLifecycleCallbacks()
 */
class SalesItemEntity implements KisphpEntityInterface, SalesItemEntityInterface
{
    /**
     * @var string
     *
     * @ORM\Column(type="integer", options={"unsigned": true})
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var string
     *
     * @ORM\Column(type="integer", options={"unsigned": true})
     */
    protected $id_order;

    /**
     * @var SalesEntityInterface
     *
     * @ORM\ManyToOne(targetEntity="SalesEntity", inversedBy="items")
     * @ORM\JoinColumn(name="id_order", referencedColumnName="id")
     */
    protected $order;

    /**
     * @var int
     *
     * @ORM\Column(type="integer")
     */
    protected $id_product;

    /**
     * @var int
     *
     * @ORM\Column(type="integer")
     */
    protected $id_category;

    /**
     * @var int
     *
     * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
     */
    protected $quantity = 0;

    /**
     * @var \DateTime
     * @ORM\Column(type="datetime")
     */
    protected $registered;

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_sku;

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_code;

    /**
     * @var int
     *
     * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
     */
    protected $product_price;

    /**
     * @var int
     *
     * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
     */
    protected $product_price_old;

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_currency;

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_title;

    /**
     * @var string
     *
     * @ORM\Column(type="text", nullable=true)
     */
    protected $product_description;

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_image_directory = 'default';

    /**
     * @var string
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $product_image_filename = 'no-image.png';

    /**
     * @ORM\PrePersist()
     */
    public function updateModifiedDatetime()
    {
        if ($this->registered === null) {
            $this->setRegistered(new \DateTime());
        }
    }

    /**
     * @return \DateTime
     */
    public function getRegistered()
    {
        return $this->registered;
    }

    /**
{'fraction_non_alphanumeric': 0.16828591256072173, 'fraction_numerical': 0.008327550312283136, 'mean_word_length': 2.186843559977888, 'pattern_counts': {'":': 20, '<': 5, '<?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': '358326', 'n_tokens_mistral': 1927, 'n_tokens_neox': 1842, 'n_words': 302}