diff --git a/index.md b/index.md index 28a85241ffcd85693a3ada67c8e3c404bd702c9d..be65909edc745f3e32b6d2dd82ae9228267e1a7b 100644 --- a/index.md +++ b/index.md @@ -161,7 +161,6 @@ hydrater les entités. class ArticleContent { private $content; - private $lastModification; public function __construct(string $content) { @@ -169,16 +168,10 @@ class ArticleContent throw new ArticleHasNoContent(); } $this->content = $content; - $this->lastModification = new \DatetimeImmutable(); } } ``` -Instanciation: -```php -new Article(new ArticleContent('This is a very short but nice article')); -``` - Note: - Déportation de la validation dans les value objects - Début d'arborescence @@ -200,6 +193,8 @@ class Article Instanciation: ```php +new Article(new ArticleContent('This is a very short but nice article')); +// devient Article::createFromNative('This is a very short but nice article'); ```