first commit

This commit is contained in:
2025-01-06 20:47:25 +01:00
commit 3bdbd78c2f
25591 changed files with 3586440 additions and 0 deletions

View File

@@ -0,0 +1,346 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
namespace PrestaShop\Module\ProductComment\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table()
* @ORM\Entity()
*/
class ProductComment
{
const TITLE_MAX_LENGTH = 64;
const CUSTOMER_NAME_MAX_LENGTH = 64;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id_product_comment", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var int
*
* @ORM\Column(name="id_product", type="integer")
*/
private $productId;
/**
* @var int
*
* @ORM\Column(name="id_customer", type="integer")
*/
private $customerId;
/**
* @var int
*
* @ORM\Column(name="id_guest", type="integer")
*/
private $guestId;
/**
* @var string
*
* @ORM\Column(name="customer_name", type="string", length=64)
*/
private $customerName;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=64)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="content", type="text")
*/
private $content;
/**
* @var int
*
* @ORM\Column(name="grade", type="integer")
*/
private $grade;
/**
* @var bool
*
* @ORM\Column(name="validate", type="boolean")
*/
private $validate = false;
/**
* @var bool
*
* @ORM\Column(name="deleted", type="boolean")
*/
private $deleted = false;
/**
* @var \DateTime
*
* @ORM\Column(name="date_add", type="datetime")
*/
private $dateAdd;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return int
*/
public function getProductId()
{
return $this->productId;
}
/**
* @param int $productId
*
* @return ProductComment
*/
public function setProductId($productId)
{
$this->productId = $productId;
return $this;
}
/**
* @return int
*/
public function getCustomerId()
{
return $this->customerId;
}
/**
* @param int $customerId
*
* @return ProductComment
*/
public function setCustomerId($customerId)
{
$this->customerId = $customerId;
return $this;
}
/**
* @return int
*/
public function getGuestId()
{
return $this->guestId;
}
/**
* @param int $guestId
*
* @return ProductComment
*/
public function setGuestId($guestId)
{
$this->guestId = $guestId;
return $this;
}
/**
* @return string
*/
public function getCustomerName()
{
return $this->customerName;
}
/**
* @param string $customerName
*
* @return ProductComment
*/
public function setCustomerName($customerName)
{
$this->customerName = $customerName;
return $this;
}
/**
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* @param string $title
*
* @return ProductComment
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* @param string $content
*
* @return ProductComment
*/
public function setContent($content)
{
$this->content = $content;
return $this;
}
/**
* @return int
*/
public function getGrade()
{
return $this->grade;
}
/**
* @param int $grade
*
* @return ProductComment
*/
public function setGrade($grade)
{
$this->grade = $grade;
return $this;
}
/**
* @return bool
*/
public function isValidate()
{
return $this->validate;
}
/**
* @param bool $validate
*
* @return ProductComment
*/
public function setValidate($validate)
{
$this->validate = $validate;
return $this;
}
/**
* @return bool
*/
public function isDeleted()
{
return $this->deleted;
}
/**
* @param bool $deleted
*
* @return ProductComment
*/
public function setDeleted($deleted)
{
$this->deleted = $deleted;
return $this;
}
/**
* @return \DateTime
*/
public function getDateAdd()
{
return $this->dateAdd;
}
/**
* Date is stored in UTC timezone
*
* @param \DateTime $dateAdd
*
* @return ProductComment
*/
public function setDateAdd($dateAdd)
{
$this->dateAdd = $dateAdd;
return $this;
}
/**
* @return array
*/
public function toArray()
{
return [
'id_product' => $this->getProductId(),
'id_product_comment' => $this->getId(),
'title' => $this->getTitle(),
'content' => $this->getContent(),
'customer_name' => $this->getCustomerName(),
'date_add' => $this->dateAdd->format(\DateTime::ATOM),
'grade' => $this->grade,
'usefulness' => 3,
'total_usefulness' => 5,
];
}
}

View File

@@ -0,0 +1,111 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
namespace PrestaShop\Module\ProductComment\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table()
* @ORM\Entity()
*/
class ProductCommentCriterion
{
const ENTIRE_CATALOG_TYPE = 1;
const CATEGORIES_TYPE = 2;
const PRODUCTS_TYPE = 3;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id_product_comment_criterion", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var int
*
* @ORM\Column(name="id_product_comment_criterion_type", type="integer")
*/
private $type;
/**
* @var bool
*
* @ORM\Column(name="active", type="boolean")
*/
private $active = false;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return int
*/
public function getType()
{
return $this->type;
}
/**
* @param int $type
*
* @return ProductCommentCriterion
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* @return bool
*/
public function isActive()
{
return $this->active;
}
/**
* @param bool $active
*
* @return ProductCommentCriterion
*/
public function setActive($active)
{
$this->active = $active;
return $this;
}
}

View File

@@ -0,0 +1,88 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
namespace PrestaShop\Module\ProductComment\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table()
* @ORM\Entity()
*/
class ProductCommentGrade
{
/**
* @ORM\Id
* @ORM\ManyToOne(targetEntity="ProductComment")
* @ORM\JoinColumn(name="id_product_comment", referencedColumnName="id_product_comment")
*/
private $comment;
/**
* @ORM\Id
* @ORM\ManyToOne(targetEntity="ProductCommentCriterion")
* @ORM\JoinColumn(name="id_product_comment_criterion", referencedColumnName="id_product_comment_criterion")
*/
private $criterion;
/**
* @var int
*
* @ORM\Column(name="grade", type="integer")
*/
private $grade;
/**
* @param ProductComment $comment
* @param ProductCommentCriterion $criterion
* @param int $grade
*/
public function __construct(
ProductComment $comment,
ProductCommentCriterion $criterion,
$grade
) {
$this->comment = $comment;
$this->criterion = $criterion;
$this->grade = $grade;
}
/**
* @return mixed
*/
public function getComment()
{
return $this->comment;
}
/**
* @return mixed
*/
public function getCriterion()
{
return $this->criterion;
}
}

View File

@@ -0,0 +1,81 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
namespace PrestaShop\Module\ProductComment\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table()
* @ORM\Entity()
*/
class ProductCommentReport
{
/**
* @ORM\Id
* @ORM\ManyToOne(targetEntity="ProductComment")
* @ORM\JoinColumn(name="id_product_comment", referencedColumnName="id_product_comment")
*
* @var ProductComment
*/
private $comment;
/**
* @ORM\Id
* @ORM\Column(name="id_customer", type="integer")
*
* @var int
*/
private $customerId;
/**
* @param ProductComment $comment
* @param int $customerId
*/
public function __construct(
ProductComment $comment,
$customerId
) {
$this->comment = $comment;
$this->customerId = $customerId;
}
/**
* @return ProductComment
*/
public function getComment()
{
return $this->comment;
}
/**
* @return int
*/
public function getCustomerId()
{
return $this->customerId;
}
}

View File

@@ -0,0 +1,109 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
namespace PrestaShop\Module\ProductComment\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table()
* @ORM\Entity()
*/
class ProductCommentUsefulness
{
/**
* @ORM\Id
* @ORM\ManyToOne(targetEntity="ProductComment")
* @ORM\JoinColumn(name="id_product_comment", referencedColumnName="id_product_comment")
*/
private $comment;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id_customer", type="integer")
*/
private $customerId;
/**
* @var bool
*
* @ORM\Column(name="usefulness", type="boolean")
*/
private $usefulness;
/**
* @param ProductComment $comment
* @param int $customerId
* @param bool $usefulness
*/
public function __construct(
ProductComment $comment,
$customerId,
$usefulness
) {
$this->comment = $comment;
$this->customerId = $customerId;
$this->usefulness = $usefulness;
}
/**
* @return mixed
*/
public function getComment()
{
return $this->comment;
}
/**
* @return int
*/
public function getCustomerId()
{
return $this->customerId;
}
/**
* @return bool
*/
public function isUsefulness()
{
return $this->usefulness;
}
/**
* @param bool $usefulness
*
* @return ProductCommentUsefulness
*/
public function setUsefulness($usefulness)
{
$this->usefulness = $usefulness;
return $this;
}
}

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;