[DOCS] 7.5 Docs Part 3/4
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / 7.5 / Important-69084-AddingExtbaseObjectsWithNOTNULLColumnsHasChanged.rst
1 ============================================================================
2 Important: #69084 - Adding Extbase Objects with NOT NULL columns has changed
3 ============================================================================
4
5 Description
6 ===========
7
8 To better support databases that don't silently convert ``NULL`` values to
9 an empty default value for database columns defined as ``NOT NULL`` the
10 ``insertObject()`` method tries to determine the appropriate value for a column.
11
12 Extbase object properties that have a value of ``NULL`` will be skipped when
13 preparing the record to enable the DBMS default value to be used. This behavior
14 has not changed compared to TYPO3 CMS 7.4 but allows proper support for DBMS that
15 are strict about ``NOT NULL`` columns by defining appropriate default values for
16 properties in the models.
17
18
19 Example database schema:
20
21 .. code-block:: sql
22
23 CREATE TABLE tx_blogexample_domain_model_blog (
24 title varchar(255) DEFAULT '' NOT NULL
25 );
26
27 Example model definition:
28
29 .. code-block:: php
30
31 class Blog extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
32
33 /**
34 * The blog's title.
35 *
36 * @var string
37 */
38 protected $title = '';
39
40 }