diff --git a/demodoctrine/README.md b/demodoctrine/README.md index 26254bcc..096b3158 100644 --- a/demodoctrine/README.md +++ b/demodoctrine/README.md @@ -1,10 +1,12 @@ Demo Doctrine ===================== -This module demonstrates how to use Doctrine entities in PrestaShop 1.7.7. +This module demonstrates how to use Doctrine entities in PrestaShop 1.7.7 and 1.7.8 versions. Please note this module is an example only, not a mandatory structure. +![Demo Doctrine Screenshot](demodoctrine-screenshot.png) + ## Requirements 1. Composer, see [Composer](https://getcomposer.org/) to learn more diff --git a/demodoctrine/Resources/data/install.sql b/demodoctrine/Resources/data/install.sql index aacd8421..5834c03c 100644 --- a/demodoctrine/Resources/data/install.sql +++ b/demodoctrine/Resources/data/install.sql @@ -1,2 +1,2 @@ CREATE TABLE IF NOT EXISTS `PREFIX_quote` (id_quote INT AUTO_INCREMENT NOT NULL, author VARCHAR(255) NOT NULL, date_add DATETIME NOT NULL, date_upd DATETIME NOT NULL, PRIMARY KEY(id_quote)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB -CREATE TABLE IF NOT EXISTS `PREFIX_quote_lang` (id_quote INT NOT NULL, id_lang INT NOT NULL, content LONGTEXT NOT NULL, INDEX IDX_4D76F37E85F48AC4 (id_quote), INDEX IDX_4D76F37EBA299860 (id_lang), PRIMARY KEY(id_quote, id_lang)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB +CREATE TABLE IF NOT EXISTS `PREFIX_quote_lang` (id_quote INT NOT NULL, id_lang INT NOT NULL, content LONGTEXT NULL, INDEX IDX_4D76F37E85F48AC4 (id_quote), INDEX IDX_4D76F37EBA299860 (id_lang), PRIMARY KEY(id_quote, id_lang)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB diff --git a/demodoctrine/demodoctrine-screenshot.png b/demodoctrine/demodoctrine-screenshot.png new file mode 100644 index 00000000..b681aa0a Binary files /dev/null and b/demodoctrine/demodoctrine-screenshot.png differ diff --git a/demodoctrine/src/Entity/QuoteLang.php b/demodoctrine/src/Entity/QuoteLang.php index 2b8eeab0..9cafded6 100644 --- a/demodoctrine/src/Entity/QuoteLang.php +++ b/demodoctrine/src/Entity/QuoteLang.php @@ -38,7 +38,7 @@ class QuoteLang /** * @var string - * @ORM\Column(name="content", type="string", nullable=false) + * @ORM\Column(name="content", type="string", nullable=true) */ private $content; @@ -92,7 +92,7 @@ public function getContent() * @param string $content * @return $this */ - public function setContent(string $content) + public function setContent(?string $content) { $this->content = $content;