Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete obsolete fields #2797

Draft
wants to merge 10 commits into
base: bleeding
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function load(ObjectManager $manager)
$manager->getConnection()->exec(
'INSERT INTO ApplicationServerSetRelApplicationServers(applicationServerId, applicationServerSetId ) SELECT id, 0 FROM ApplicationServers WHERE id != 3'
);

$item1 = $this->createEntityInstance(ApplicationServerSetRelApplicationServer::class);
(function () use ($fixture) {
$this->setApplicationServer($fixture->getReference('_reference_ProviderApplicationServer1'));
Expand All @@ -48,14 +49,6 @@ public function load(ObjectManager $manager)
$this->addReference('_reference_ApplicationServerSetRelApplicationServer3', $item3);
$this->sanitizeEntityValues($item3);

$item4 = $this->createEntityInstance(ApplicationServerSetRelApplicationServer::class);
(function () use ($fixture) {
$this->setApplicationServer($fixture->getReference('_reference_ProviderApplicationServer3'));
$this->setApplicationServerSet($fixture->getReference('_reference_ProviderApplicationServerSet2'));
})->call($item4);
$this->addReference('_reference_ApplicationServerSetRelApplicationServer4', $item4);
$this->sanitizeEntityValues($item4);

$manager->flush();
}
}
7 changes: 0 additions & 7 deletions library/DataFixtures/ORM/ProviderCompany.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public function load(ObjectManager $manager)
);
$this->invoicing = $invoicing;
$this->setLanguage($fixture->getReference('_reference_ProviderLanguage1'));
$this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0'));
$this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone145'));
$this->setBrand($fixture->getReference('_reference_ProviderBrand1'));
$this->setDomain($fixture->getReference('_reference_ProviderDomain3'));
Expand Down Expand Up @@ -94,7 +93,6 @@ public function load(ObjectManager $manager)
$this->setOnDemandRecordCode("");
$this->invoicing = $invoicing;
$this->setLanguage($fixture->getReference('_reference_ProviderLanguage1'));
$this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0'));
$this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone145'));
$this->setBrand($fixture->getReference('_reference_ProviderBrand1'));
$this->setDomain($fixture->getReference('_reference_ProviderDomain5'));
Expand Down Expand Up @@ -127,7 +125,6 @@ public function load(ObjectManager $manager)
$this->setShowInvoices(true);
$this->invoicing = $invoicing;
$this->setLanguage($fixture->getReference('_reference_ProviderLanguage1'));
$this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0'));
$this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone145'));
$this->setBrand($fixture->getReference('_reference_ProviderBrand1'));
$this->setCountry($fixture->getReference('_reference_ProviderCountry70'));
Expand Down Expand Up @@ -157,9 +154,7 @@ public function load(ObjectManager $manager)
$this->setOnDemandRecord(0);
$this->setOnDemandRecordCode("");
$this->invoicing = $invoicing;
$this->setApplicationServer($fixture->getReference('_reference_ProviderApplicationServer1'));
$this->setLanguage($fixture->getReference('_reference_ProviderLanguage1'));
$this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0'));
$this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone145'));
$this->setBrand($fixture->getReference('_reference_ProviderBrand1'));
$this->setCountry($fixture->getReference('_reference_ProviderCountry70'));
Expand Down Expand Up @@ -189,7 +184,6 @@ public function load(ObjectManager $manager)
$this->setOnDemandRecordCode("");
$this->invoicing = $invoicing;
$this->setLanguage($fixture->getReference('_reference_ProviderLanguage1'));
$this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0'));
$this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone145'));
$this->setBrand($fixture->getReference('_reference_ProviderBrand1'));
$this->setCountry($fixture->getReference('_reference_ProviderCountry70'));
Expand Down Expand Up @@ -221,7 +215,6 @@ public function load(ObjectManager $manager)
$this->setOnDemandRecordCode("");
$this->invoicing = $invoicing;
$this->setLanguage($fixture->getReference('_reference_ProviderLanguage1'));
$this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0'));
$this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone18'));
$this->setBrand($fixture->getReference('_reference_ProviderBrand2'));
$this->setCountry($fixture->getReference('_reference_ProviderCountry10'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
*/
interface ApplicationServerSetRelApplicationServerRepository extends RepositoryInterface
{
/**
* @return ApplicationServerSetRelApplicationServerInterface[]
*/
public function findByApplicationServerId(int $applicationServerId): array;
}
21 changes: 0 additions & 21 deletions library/Ivoz/Provider/Domain/Model/Carrier/CarrierAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ abstract class CarrierAbstract
*/
protected $proxyTrunk = null;

/**
* @var ?MediaRelaySetInterface
*/
protected $mediaRelaySets = null;

/**
* @var MediaRelaySetInterface
*/
Expand Down Expand Up @@ -171,7 +166,6 @@ public static function fromDto(
->setTransformationRuleSet($fkTransformer->transform($dto->getTransformationRuleSet()))
->setCurrency($fkTransformer->transform($dto->getCurrency()))
->setProxyTrunk($fkTransformer->transform($dto->getProxyTrunk()))
->setMediaRelaySets($fkTransformer->transform($dto->getMediaRelaySets()))
->setMediaRelaySet($fkTransformer->transform($mediaRelaySet));

$self->initChangelog();
Expand Down Expand Up @@ -207,7 +201,6 @@ public function updateFromDto(
->setTransformationRuleSet($fkTransformer->transform($dto->getTransformationRuleSet()))
->setCurrency($fkTransformer->transform($dto->getCurrency()))
->setProxyTrunk($fkTransformer->transform($dto->getProxyTrunk()))
->setMediaRelaySets($fkTransformer->transform($dto->getMediaRelaySets()))
->setMediaRelaySet($fkTransformer->transform($mediaRelaySet));

return $this;
Expand All @@ -227,7 +220,6 @@ public function toDto(int $depth = 0): CarrierDto
->setTransformationRuleSet(TransformationRuleSet::entityToDto(self::getTransformationRuleSet(), $depth))
->setCurrency(Currency::entityToDto(self::getCurrency(), $depth))
->setProxyTrunk(ProxyTrunk::entityToDto(self::getProxyTrunk(), $depth))
->setMediaRelaySets(MediaRelaySet::entityToDto(self::getMediaRelaySets(), $depth))
->setMediaRelaySet(MediaRelaySet::entityToDto(self::getMediaRelaySet(), $depth));
}

Expand All @@ -245,7 +237,6 @@ protected function __toArray(): array
'transformationRuleSetId' => self::getTransformationRuleSet()?->getId(),
'currencyId' => self::getCurrency()?->getId(),
'proxyTrunkId' => self::getProxyTrunk()?->getId(),
'mediaRelaySetsId' => self::getMediaRelaySets()?->getId(),
'mediaRelaySetId' => self::getMediaRelaySet()->getId()
];
}
Expand Down Expand Up @@ -354,18 +345,6 @@ public function getProxyTrunk(): ?ProxyTrunkInterface
return $this->proxyTrunk;
}

protected function setMediaRelaySets(?MediaRelaySetInterface $mediaRelaySets = null): static
{
$this->mediaRelaySets = $mediaRelaySets;

return $this;
}

public function getMediaRelaySets(): ?MediaRelaySetInterface
{
return $this->mediaRelaySets;
}

protected function setMediaRelaySet(MediaRelaySetInterface $mediaRelaySet): static
{
$this->mediaRelaySet = $mediaRelaySet;
Expand Down
37 changes: 0 additions & 37 deletions library/Ivoz/Provider/Domain/Model/Carrier/CarrierDtoAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ abstract class CarrierDtoAbstract implements DataTransferObjectInterface
*/
private $proxyTrunk = null;

/**
* @var MediaRelaySetDto | null
*/
private $mediaRelaySets = null;

/**
* @var MediaRelaySetDto | null
*/
Expand Down Expand Up @@ -127,7 +122,6 @@ public static function getPropertyMap(string $context = '', string $role = null)
'transformationRuleSetId' => 'transformationRuleSet',
'currencyId' => 'currency',
'proxyTrunkId' => 'proxyTrunk',
'mediaRelaySetsId' => 'mediaRelaySets',
'mediaRelaySetId' => 'mediaRelaySet'
];
}
Expand All @@ -147,7 +141,6 @@ public function toArray(bool $hideSensitiveData = false): array
'transformationRuleSet' => $this->getTransformationRuleSet(),
'currency' => $this->getCurrency(),
'proxyTrunk' => $this->getProxyTrunk(),
'mediaRelaySets' => $this->getMediaRelaySets(),
'mediaRelaySet' => $this->getMediaRelaySet(),
'outgoingRoutings' => $this->getOutgoingRoutings(),
'outgoingRoutingsRelCarriers' => $this->getOutgoingRoutingsRelCarriers(),
Expand Down Expand Up @@ -353,36 +346,6 @@ public function getProxyTrunkId(): ?int
return null;
}

public function setMediaRelaySets(?MediaRelaySetDto $mediaRelaySets): static
{
$this->mediaRelaySets = $mediaRelaySets;

return $this;
}

public function getMediaRelaySets(): ?MediaRelaySetDto
{
return $this->mediaRelaySets;
}

public function setMediaRelaySetsId(?int $id): static
{
$value = !is_null($id)
? new MediaRelaySetDto($id)
: null;

return $this->setMediaRelaySets($value);
}

public function getMediaRelaySetsId(): ?int
{
if ($dto = $this->getMediaRelaySets()) {
return $dto->getId();
}

return null;
}

public function setMediaRelaySet(?MediaRelaySetDto $mediaRelaySet): static
{
$this->mediaRelaySet = $mediaRelaySet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ public function getCurrency(): ?CurrencyInterface;

public function getProxyTrunk(): ?ProxyTrunkInterface;

public function getMediaRelaySets(): ?MediaRelaySetInterface;

public function getMediaRelaySet(): MediaRelaySetInterface;

public function addOutgoingRouting(OutgoingRoutingInterface $outgoingRouting): CarrierInterface;
Expand Down
48 changes: 2 additions & 46 deletions library/Ivoz/Provider/Domain/Model/Company/CompanyAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
use Ivoz\Core\Domain\ForeignKeyTransformerInterface;
use Ivoz\Provider\Domain\Model\Company\Invoicing;
use Ivoz\Provider\Domain\Model\Language\LanguageInterface;
use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySetInterface;
use Ivoz\Provider\Domain\Model\Timezone\TimezoneInterface;
use Ivoz\Provider\Domain\Model\Brand\BrandInterface;
use Ivoz\Provider\Domain\Model\Domain\DomainInterface;
use Ivoz\Provider\Domain\Model\ApplicationServer\ApplicationServerInterface;
use Ivoz\Provider\Domain\Model\Country\CountryInterface;
use Ivoz\Provider\Domain\Model\Currency\CurrencyInterface;
use Ivoz\Provider\Domain\Model\TransformationRuleSet\TransformationRuleSetInterface;
Expand All @@ -24,12 +22,11 @@
use Ivoz\Provider\Domain\Model\NotificationTemplate\NotificationTemplateInterface;
use Ivoz\Provider\Domain\Model\Corporation\CorporationInterface;
use Ivoz\Provider\Domain\Model\ApplicationServerSet\ApplicationServerSetInterface;
use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySetInterface;
use Ivoz\Provider\Domain\Model\Language\Language;
use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySet;
use Ivoz\Provider\Domain\Model\Timezone\Timezone;
use Ivoz\Provider\Domain\Model\Brand\Brand;
use Ivoz\Provider\Domain\Model\Domain\Domain;
use Ivoz\Provider\Domain\Model\ApplicationServer\ApplicationServer;
use Ivoz\Provider\Domain\Model\Country\Country;
use Ivoz\Provider\Domain\Model\Currency\Currency;
use Ivoz\Provider\Domain\Model\TransformationRuleSet\TransformationRuleSet;
Expand All @@ -38,6 +35,7 @@
use Ivoz\Provider\Domain\Model\NotificationTemplate\NotificationTemplate;
use Ivoz\Provider\Domain\Model\Corporation\Corporation;
use Ivoz\Provider\Domain\Model\ApplicationServerSet\ApplicationServerSet;
use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySet;

/**
* CompanyAbstract
Expand Down Expand Up @@ -153,11 +151,6 @@ abstract class CompanyAbstract
*/
protected $language = null;

/**
* @var ?MediaRelaySetInterface
*/
protected $mediaRelaySets = null;

/**
* @var ?TimezoneInterface
*/
Expand All @@ -174,11 +167,6 @@ abstract class CompanyAbstract
*/
protected $domain = null;

/**
* @var ?ApplicationServerInterface
*/
protected $applicationServer = null;

/**
* @var CountryInterface
*/
Expand Down Expand Up @@ -401,11 +389,9 @@ public static function fromDto(
->setBalance($dto->getBalance())
->setShowInvoices($dto->getShowInvoices())
->setLanguage($fkTransformer->transform($dto->getLanguage()))
->setMediaRelaySets($fkTransformer->transform($dto->getMediaRelaySets()))
->setDefaultTimezone($fkTransformer->transform($dto->getDefaultTimezone()))
->setBrand($fkTransformer->transform($brand))
->setDomain($fkTransformer->transform($dto->getDomain()))
->setApplicationServer($fkTransformer->transform($dto->getApplicationServer()))
->setCountry($fkTransformer->transform($country))
->setCurrency($fkTransformer->transform($dto->getCurrency()))
->setTransformationRuleSet($fkTransformer->transform($dto->getTransformationRuleSet()))
Expand Down Expand Up @@ -501,11 +487,9 @@ public function updateFromDto(
->setShowInvoices($dto->getShowInvoices())
->setInvoicing($invoicing)
->setLanguage($fkTransformer->transform($dto->getLanguage()))
->setMediaRelaySets($fkTransformer->transform($dto->getMediaRelaySets()))
->setDefaultTimezone($fkTransformer->transform($dto->getDefaultTimezone()))
->setBrand($fkTransformer->transform($brand))
->setDomain($fkTransformer->transform($dto->getDomain()))
->setApplicationServer($fkTransformer->transform($dto->getApplicationServer()))
->setCountry($fkTransformer->transform($country))
->setCurrency($fkTransformer->transform($dto->getCurrency()))
->setTransformationRuleSet($fkTransformer->transform($dto->getTransformationRuleSet()))
Expand Down Expand Up @@ -555,11 +539,9 @@ public function toDto(int $depth = 0): CompanyDto
->setInvoicingProvince(self::getInvoicing()->getProvince())
->setInvoicingCountryName(self::getInvoicing()->getCountryName())
->setLanguage(Language::entityToDto(self::getLanguage(), $depth))
->setMediaRelaySets(MediaRelaySet::entityToDto(self::getMediaRelaySets(), $depth))
->setDefaultTimezone(Timezone::entityToDto(self::getDefaultTimezone(), $depth))
->setBrand(Brand::entityToDto(self::getBrand(), $depth))
->setDomain(Domain::entityToDto(self::getDomain(), $depth))
->setApplicationServer(ApplicationServer::entityToDto(self::getApplicationServer(), $depth))
->setCountry(Country::entityToDto(self::getCountry(), $depth))
->setCurrency(Currency::entityToDto(self::getCurrency(), $depth))
->setTransformationRuleSet(TransformationRuleSet::entityToDto(self::getTransformationRuleSet(), $depth))
Expand Down Expand Up @@ -607,11 +589,9 @@ protected function __toArray(): array
'invoicingProvince' => self::getInvoicing()->getProvince(),
'invoicingCountryName' => self::getInvoicing()->getCountryName(),
'languageId' => self::getLanguage()?->getId(),
'mediaRelaySetsId' => self::getMediaRelaySets()?->getId(),
'defaultTimezoneId' => self::getDefaultTimezone()?->getId(),
'brandId' => self::getBrand()->getId(),
'domainId' => self::getDomain()?->getId(),
'applicationServerId' => self::getApplicationServer()?->getId(),
'countryId' => self::getCountry()->getId(),
'currencyId' => self::getCurrency()?->getId(),
'transformationRuleSetId' => self::getTransformationRuleSet()?->getId(),
Expand Down Expand Up @@ -942,18 +922,6 @@ public function getLanguage(): ?LanguageInterface
return $this->language;
}

protected function setMediaRelaySets(?MediaRelaySetInterface $mediaRelaySets = null): static
{
$this->mediaRelaySets = $mediaRelaySets;

return $this;
}

public function getMediaRelaySets(): ?MediaRelaySetInterface
{
return $this->mediaRelaySets;
}

protected function setDefaultTimezone(?TimezoneInterface $defaultTimezone = null): static
{
$this->defaultTimezone = $defaultTimezone;
Expand Down Expand Up @@ -990,18 +958,6 @@ public function getDomain(): ?DomainInterface
return $this->domain;
}

protected function setApplicationServer(?ApplicationServerInterface $applicationServer = null): static
{
$this->applicationServer = $applicationServer;

return $this;
}

public function getApplicationServer(): ?ApplicationServerInterface
{
return $this->applicationServer;
}

protected function setCountry(CountryInterface $country): static
{
$this->country = $country;
Expand Down
Loading