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

Also available in: Atom PDF