Selaa lähdekoodia

[DOC] Add default value to BlogPost sample class (#3703)

Set `BlogPost::$draft` to `false` by default.
florianlenz 9 vuotta sitten
vanhempi
commit
34139dd67f
1 muutettua tiedostoa jossa 24 lisäystä ja 0 poistoa
  1. 24 0
      Resources/doc/getting_started/creating_an_admin.rst

+ 24 - 0
Resources/doc/getting_started/creating_an_admin.rst

@@ -48,6 +48,30 @@ After this, you'll need to tweak the entities a bit:
 
 .. code-block:: php
 
+Set the default value to ``false``.
+
+.. code-block:: php
+
+    // src/AppBundle/Entity/BlogPost.php
+
+    // ...
+    class BlogPost
+    {
+        // ...
+
+        /**
+         * @var bool
+         *
+         * @ORM\Column(name="draft", type="boolean")
+         */
+        private $draft = false;
+
+        // ...
+    }
+
+.. code-block:: php
+
+
     // src/AppBundle/Entity/Category.php
 
     // ...