create generic data transformer with get an object by id, and add test

for CalendarType
This commit is contained in:
2022-05-20 19:23:47 +02:00
parent b6e0379583
commit 67fad5d764
11 changed files with 422 additions and 159 deletions

View File

@@ -0,0 +1,23 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ThirdPartyBundle\Form\DataTransformer;
use Chill\MainBundle\Form\DataTransformer\IdToEntityDataTransformer;
use Chill\ThirdPartyBundle\Repository\ThirdPartyRepository;
class ThirdPartiesToIdDataTransformer extends IdToEntityDataTransformer
{
public function __construct(ThirdPartyRepository $repository)
{
parent::__construct($repository, true);
}
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ThirdPartyBundle\Form\DataTransformer;
use Chill\MainBundle\Form\DataTransformer\IdToEntityDataTransformer;
use Chill\ThirdPartyBundle\Repository\ThirdPartyRepository;
class ThirdPartyToIdDataTransformer extends IdToEntityDataTransformer
{
public function __construct(ThirdPartyRepository $repository)
{
parent::__construct($repository, false);
}
}