[TYPO3-mvc] DataMapping on group with different tables

Thomas Waggershauser waggershauser at airware.de
Mon Nov 27 10:40:17 CET 2017


Hello everybody,

im migrating a piBase Extension to extbase. My problem is a calendar, referencing different parts using tca-group to different tables. The concrete Table is stored in the mm-table and in the past with an interface on the different classes..
Lets say the calendar references Shuttleobject (thew interface), so in cal.tca:

"columns" => array (
  ...
  "shuttleobject" => Array (
            "exclude" => 1,
            "label" => "LLL:EXT:my_ext/locallang_db.xml:tx_myext_cal.shuttleobject",
            "config" => Array (
                "type" => "group",
                "internal_type" => "db",
                "allowed" => "tx_myext_vehicle,tx_myext_targetpoint,fe_users",
                "size" => 6,
                "minitems" => 0,
                "maxitems" => 20,
                "MM" => "cal_shuttleobject_mm",
                "MM_oppositeUsage" => Array(
                    "tx_myext_vehicle" => Array(
                        0 => "cal"
                    ),
                    "tx_myext_targetpoint" => Array(
                        0 => "cal"
                    ),
                    "fe_users" => Array(
                        0 => "tx_myext_cal"
                    ),
                ),
            )
        ),

in Model\Cal:

    /**
     *
     * @var \MyVendor\MyExt\Domain\Interfaces\Shuttleobject
     * @lazy
     */
    protected $shuttleobject;

    /**
     *
     * @return \MyVendor\MyExt\Domain\Interfaces\Shuttleobject
     */
    public function getShuttleobject() {
        return $this->shuttleobject;
    }

    /**
     *
     * @param \MyVendor\MyExt\Domain\Interfaces\Shuttleobject $shuttleobject
     */
    public function setShuttleobject(Shuttleobject $shuttleobject) {
        $this->shuttleobject = $shuttleobject;
    }

The Result is:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1476045117: Could not find class definition for name "MyVendor\MyExt\Domain\Interfaces\Shuttleobject". This could be caused by a mis-spelling of the class name in the class definition. | TYPO3\CMS\Extbase\Persistence\Generic\Exception\InvalidClassException thrown in file /Users/air/htstaticdocs/typo3_src-8.7.1/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php in line 117. Requested URL: http ://localhost/shuttle8/index.php?id=66

I have no idea, of course I can switch to different mm-tables, but here are quite more objects, needing an calendar and other things to do with shuttle-objects, so the number of tables will exponentially grow :(

Is there a possibility to give the right class out of the mm-table to the data-mapper?


More information about the TYPO3-project-typo3v4mvc mailing list