Skip to content

Commit

Permalink
[TASK] CGL
Browse files Browse the repository at this point in the history
  • Loading branch information
garvinhicking committed Oct 14, 2024
1 parent 471f2d0 commit 9da1382
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Documentation/ExtensionArchitecture/BestPractises/_dto.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,16 @@ public function setLastName(string $last_name): void
// An Extbase controller utilizing DTO-to-entity transfer
class DtoController extends TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
public function __construct(protected MyVendor\MyExtension\Domain\Repository\PersonRepository $personRepository)
{
}
public function __construct(protected MyVendor\MyExtension\Domain\Repository\PersonRepository $personRepository) {}

function createAction(): Psr\Http\Message\ResponseInterface
public function createAction(): Psr\Http\Message\ResponseInterface
{
// Set up a DTO to be filled with input data.
// The Fluid template would use <f:form> and its helpers.
$this->view->assign('personDTO', new PersonDTO());
}

function saveAction(PersonDTO $personDTO): Psr\Http\Message\ResponseInterface
public function saveAction(PersonDTO $personDTO): Psr\Http\Message\ResponseInterface
{
// Transfer all data to a proper Extbase entity.
// Create an empty entity first:
Expand Down

0 comments on commit 9da1382

Please sign in to comment.