@@ -1245,23 +1245,42 @@ Each field can have a set of options applied to it. The available options
1245
1245
include ``type `` (defaults to ``string ``), ``name ``, ``length ``, ``unique ``
1246
1246
and ``nullable ``. Take a few annotations examples:
1247
1247
1248
- .. code -block :: php-annotations
1248
+ .. configuration -block ::
1249
1249
1250
- /**
1251
- * A string field with length 255 that cannot be null
1252
- * (reflecting the default values for the "type", "length" and *nullable* options)
1253
- *
1254
- * @ORM\Column()
1255
- */
1256
- protected $name;
1250
+ .. code-block :: php-annotations
1257
1251
1258
- /**
1259
- * A string field of length 150 that persists to an "email_address" column
1260
- * and has a unique index.
1261
- *
1262
- * @ORM\Column(name="email_address", unique="true", length="150")
1263
- */
1264
- protected $email;
1252
+ /**
1253
+ * A string field with length 255 that cannot be null
1254
+ * (reflecting the default values for the "type", "length" and *nullable* options)
1255
+ *
1256
+ * @ORM\Column()
1257
+ */
1258
+ protected $name;
1259
+
1260
+ /**
1261
+ * A string field of length 150 that persists to an "email_address" column
1262
+ * and has a unique index.
1263
+ *
1264
+ * @ORM\Column(name="email_address", unique="true", length="150")
1265
+ */
1266
+ protected $email;
1267
+
1268
+ .. code-block :: yaml
1269
+
1270
+ fields :
1271
+ # A string field length 255 that cannot be null
1272
+ # (reflecting the default values for the "length" and *nullable* options)
1273
+ # type attribute is necessary in yaml definitions
1274
+ name :
1275
+ type : string
1276
+
1277
+ # A string field of length 150 that persists to an "email_address" column
1278
+ # and has a unique index.
1279
+ email :
1280
+ type : string
1281
+ column : email_address
1282
+ length : 150
1283
+ unique : true
1265
1284
1266
1285
.. note ::
1267
1286
0 commit comments