Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
PlattformKonfigYamlService
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 parseCustomField
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 setEncodedValue
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 removeEncodedValue
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
1<?php declare(strict_types=1);
2
3namespace Satag\AmicronEntityBundle\Service;
4
5use Satag\AmicronEntityBundle\Entity\Kontakt;
6use Satag\AmicronEntityBundle\Util\CustomFields\CustomFieldsYaml;
7
8class PlattformKonfigYamlService extends AbstractPlattformKonfigService
9{
10    /**
11     * {@inheritdoc}
12     */
13    protected function parseCustomField(Kontakt $configEntity, string $dataIdentifier): array
14    {
15        $config = new CustomFieldsYaml($configEntity, $this->getCustmConfigurationField(), $dataIdentifier);
16
17        return [$dataIdentifier => $config->getArray()];
18    }
19
20    protected function setEncodedValue(Kontakt $configEntity, string $dataIdentifier, mixed $data): void
21    {
22        $config = new CustomFieldsYaml($configEntity, $this->getCustmConfigurationField(), $dataIdentifier);
23        $config->merge($data);
24    }
25
26    protected function removeEncodedValue(Kontakt $configEntity, string $dataIdentifier): void
27    {
28        $config = new CustomFieldsYaml($configEntity, $this->getCustmConfigurationField(), $dataIdentifier);
29        $config->remove();
30    }
31}