Feature #34867

Allow setting target type in MVC Argument

Added by Adrian Föder over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
MVC
Start date:
2012-03-15
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Yes
Complexity:

Description

Consider the following use case:

<?php

class SampleController extends \TYPO3\FLOW3\MVC\Controller\ActionController
    /**
     * 
     */
    public function initializeCreateAction() {
        $concreteClassName = $this->dummyFindOutConcreteProductProductClassName();
        $this->arguments['product']->setDataType($concreteClassName);
    }

    /**
     * @param \Acme\Northwind\Domain\Model\AbstractProduct $product
     */
    public function createAction(\Acme\Northwind\Domain\Model\AbstractProduct $product) {
    }
}
?>

Due to the fact that sub property's target types are settable, it makes sense (and is required for that use case) to allow setting the target type of an TYPO3\FLOW3\MVC\Controller\Argument, too.

Also available in: Atom PDF