Skip to content

Commit

Permalink
Merge pull request #105 from leemyongpakvn/demodoctrine--nullableQuot…
Browse files Browse the repository at this point in the history
…eForNondefaultLang

Demodoctrine: nullable Quote's content for nonDefault language
  • Loading branch information
matks authored Oct 10, 2022
2 parents d49aeb1 + c02287d commit 4a7d8a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion demodoctrine/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion demodoctrine/Resources/data/install.sql
Original file line number Diff line number Diff line change
@@ -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
Binary file added demodoctrine/demodoctrine-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions demodoctrine/src/Entity/QuoteLang.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 4a7d8a1

Please sign in to comment.