Project

General

Profile

Actions

Bug #91677

closed

Exbase Domain Model __construct not called

Added by This Mächler over 4 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2020-06-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.2
Tags:
__construct constructor domain model extbase
Complexity:
Is Regression:
Sprint Focus:

Description

In my domain model class, the constructor is never called. If I write something like this, nothing happens (no php error, $bla->blu() doesn't exist:

public function __construct( ) {
  $bla->blu();
}

It seems that the domain objects are cloned:

public function __clone( ) {
  $bla->blu();
}

This leads to an error: "Call to a member function blu() on null"
In the documentation, the __constructor is falsely mentioned. Or I get something wrong:

https://docs.typo3.org/m/typo3/book-extbasefluid/master/en-us/5-Domain/2-implementing-the-domain-model.html


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #94377: Deprecate extbase ObjectManager->getEmptyObject()Closed2021-06-18

Actions
Actions #1

Updated by Oliver Hader over 4 years ago

  • Category changed from Documentation to Extbase
Actions #2

Updated by Christian Kuhn almost 3 years ago

  • Related to Task #94377: Deprecate extbase ObjectManager->getEmptyObject() added
Actions #3

Updated by Christian Kuhn almost 3 years ago

  • Status changed from New to Resolved

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.3/Deprecation-94377-ExtbaseObjectManager-getEmptyObject.html

We deprecated this behavior in v11 and removed it in v12 - __construct() is now reliably called when objects are "thawed" / "hydrated" from persistence.

Actions #4

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF