dba50efad004447cc076f20a8d83ff079381fc30
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / master / 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 column defined as NOT NULL the
10 `├ČnsertObject()`` method tries to determine the appropriate value for
11 a column.
12
13 Extbase object properties that have a value of NULL will be skipped when
14 preparing the record to enable the DBMS default value to be used. This
15 behavior has not changed compared to TYPO3 CMS 7.4 but allows proper
16 support for DBMS that are strict about NOT NULL columns by defining
17 appropriate default values for properties in the models.
18
19
20 Example database schema:
21
22 .. code-block:: sql
23
24 CREATE TABLE tx_blogexample_domain_model_blog (
25 title varchar(255) DEFAULT '' NOT NULL
26 );
27
28 Example model definition:
29
30 .. code-block:: php
31
32 class Blog extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
33
34 /**
35 * The blog's title.
36 *
37 * @var string
38 */
39 protected $title = '';
40
41 }