Issue Bug Closed

#92148Serialization of Repository is broken

Raphael Mutschler 09/01/20, 15:15 updated 12/06/22, 21:43

Description

In v10 when serializing a Domainmodel with an injected Repository the following exception is thrown:

(1/1) Exception
Serialization of 'Closure' is not allowed

Example Code

Model:

namespace FreyhauerTeam\FySeminars\Domain\Model;

class Lecturer extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{

  /**
   * timeslotRepository
   *
   * @var \FreyhauerTeam\FySeminars\Domain\Repository\TimeslotRepository
   * @TYPO3\CMS\Extbase\Annotation\Inject
   */
  protected $timeslotRepository = null;

  [...]
}

Controller:

// $lecturer = Class Lecturer
serialize($lecturer)

Reviews 2