replace fqdn in customfields bundle

This commit is contained in:
Julien Fastré 2022-04-30 00:46:48 +02:00
parent 6da19b0135
commit f26d50a3a8
10 changed files with 22 additions and 19 deletions

View File

@ -119,7 +119,7 @@ class CreateFieldsOnGroupCommand extends Command
$em = $this->entityManager; $em = $this->entityManager;
$customFieldsGroups = $em $customFieldsGroups = $em
->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup') ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
->findAll(); ->findAll();
if (count($customFieldsGroups) === 0) { if (count($customFieldsGroups) === 0) {

View File

@ -138,7 +138,7 @@ class CustomFieldController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillCustomFieldsBundle:CustomField')->find($id); $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomField::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find CustomField entity.'); throw $this->createNotFoundException('Unable to find CustomField entity.');

View File

@ -92,7 +92,7 @@ class CustomFieldsGroupController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')->find($id); $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.'); throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');
@ -113,7 +113,7 @@ class CustomFieldsGroupController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$cfGroups = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')->findAll(); $cfGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->findAll();
$defaultGroups = $this->getDefaultGroupsId(); $defaultGroups = $this->getDefaultGroupsId();
$makeDefaultFormViews = []; $makeDefaultFormViews = [];
@ -143,7 +143,7 @@ class CustomFieldsGroupController extends AbstractController
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$cFGroup = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')->findOneById($cFGroupId); $cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->findOneById($cFGroupId);
if (!$cFGroup) { if (!$cFGroup) {
throw $this throw $this
@ -151,7 +151,7 @@ class CustomFieldsGroupController extends AbstractController
. "id {$cFGroupId}"); . "id {$cFGroupId}");
} }
$cFDefaultGroup = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsDefaultGroup') $cFDefaultGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsDefaultGroup::class)
->findOneByEntity($cFGroup->getEntity()); ->findOneByEntity($cFGroup->getEntity());
if ($cFDefaultGroup) { if ($cFDefaultGroup) {
@ -204,7 +204,7 @@ class CustomFieldsGroupController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')->find($id); $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find CustomFieldsGroups entity.'); throw $this->createNotFoundException('Unable to find CustomFieldsGroups entity.');
@ -248,7 +248,7 @@ class CustomFieldsGroupController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')->find($id); $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.'); throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');
@ -272,7 +272,7 @@ class CustomFieldsGroupController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')->find($id); $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.'); throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');

View File

@ -19,6 +19,9 @@ use function array_key_exists;
use const JSON_THROW_ON_ERROR; use const JSON_THROW_ON_ERROR;
/**
* Not in use ? Deprecated ?
*/
class JsonCustomFieldToArrayTransformer implements DataTransformerInterface class JsonCustomFieldToArrayTransformer implements DataTransformerInterface
{ {
private array $customField; private array $customField;

View File

@ -156,7 +156,7 @@ final class PersonController extends AbstractController
{ {
$cFGroup = null; $cFGroup = null;
$cFDefaultGroup = $this->em->getRepository('ChillCustomFieldsBundle:CustomFieldsDefaultGroup') $cFDefaultGroup = $this->em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsDefaultGroup::class)
->findOneByEntity('Chill\\PersonBundle\\Entity\\Person'); ->findOneByEntity('Chill\\PersonBundle\\Entity\\Person');
if ($cFDefaultGroup) { if ($cFDefaultGroup) {

View File

@ -133,7 +133,7 @@ class PersonListWidget implements WidgetInterface
if (isset($config['custom_fields'])) { if (isset($config['custom_fields'])) {
if (count($config['custom_fields']) > 0) { if (count($config['custom_fields']) > 0) {
$cfs = $this->entityManager $cfs = $this->entityManager
->getRepository('ChillCustomFieldsBundle:CustomField') ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomField::class)
->findBy(['slug' => $config['custom_fields']]); ->findBy(['slug' => $config['custom_fields']]);
// store the custom fields in a array // store the custom fields in a array
foreach ($cfs as $cf) { foreach ($cfs as $cf) {

View File

@ -75,7 +75,7 @@ class ReportController extends AbstractController
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = new Report(); $entity = new Report();
$cFGroup = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup') $cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
->find($cf_group_id); ->find($cf_group_id);
$person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class) $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)
@ -186,7 +186,7 @@ class ReportController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$cFGroup = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')->find($cf_group_id); $cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($cf_group_id);
$reports = $em->getRepository('ChillReportBundle:Report')->findByCFGroup($cFGroup); $reports = $em->getRepository('ChillReportBundle:Report')->findByCFGroup($cFGroup);
$response = $this->render('ChillReportBundle:Report:export.csv.twig', [ $response = $this->render('ChillReportBundle:Report:export.csv.twig', [
@ -271,7 +271,7 @@ class ReportController extends AbstractController
$person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id); $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id);
$cFGroup = $em $cFGroup = $em
->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup') ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
->find($cf_group_id); ->find($cf_group_id);
if (null === $person) { if (null === $person) {
@ -343,7 +343,7 @@ class ReportController extends AbstractController
); );
} }
$cFGroups = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup') $cFGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
->findByEntity('Chill\ReportBundle\Entity\Report'); ->findByEntity('Chill\ReportBundle\Entity\Report');
if (count($cFGroups) === 1) { if (count($cFGroups) === 1) {
@ -402,7 +402,7 @@ class ReportController extends AbstractController
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$cFGroups = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup') $cFGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
->findByEntity('Chill\ReportBundle\Entity\Report'); ->findByEntity('Chill\ReportBundle\Entity\Report');
if (count($cFGroups) === 1) { if (count($cFGroups) === 1) {

View File

@ -63,7 +63,7 @@ final class ReportControllerNextTest extends WebTestCase
// get custom fields group from fixture // get custom fields group from fixture
$customFieldsGroups = self::$kernel->getContainer() $customFieldsGroups = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup') ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
->findBy(['entity' => 'Chill\ReportBundle\Entity\Report']); ->findBy(['entity' => 'Chill\ReportBundle\Entity\Report']);
//filter customFieldsGroup to get only "situation de logement" //filter customFieldsGroup to get only "situation de logement"
$filteredCustomFieldsGroupHouse = array_filter( $filteredCustomFieldsGroupHouse = array_filter(

View File

@ -81,7 +81,7 @@ final class ReportControllerTest extends WebTestCase
$customFieldsGroups = self::$kernel->getContainer() $customFieldsGroups = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup') ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
->findBy(['entity' => 'Chill\ReportBundle\Entity\Report']); ->findBy(['entity' => 'Chill\ReportBundle\Entity\Report']);
//filter customFieldsGroup to get only "situation de logement" //filter customFieldsGroup to get only "situation de logement"
$filteredCustomFieldsGroupHouse = array_filter( $filteredCustomFieldsGroupHouse = array_filter(

View File

@ -180,7 +180,7 @@ final class TimelineProviderTest extends WebTestCase
private function getHousingCustomFieldsGroup() private function getHousingCustomFieldsGroup()
{ {
$groups = self::$em $groups = self::$em
->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup') ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
->findAll(); ->findAll();
foreach ($groups as $group) { foreach ($groups as $group) {