Browse Source

Merchant model : ajout d'une méthode permettant de récupérer une config donnée.

reduction
Guillaume 4 years ago
parent
commit
3cb1d30767
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      ShopBundle/Model/Merchant.php

+ 13
- 0
ShopBundle/Model/Merchant.php View File

@@ -165,6 +165,19 @@ abstract class Merchant extends AbstractDocumentEntity
return $this;
}

public function getMerchantConfig($name)
{
if($this->getMerchantConfigs()) {
foreach($this->getMerchantConfigs() as $merchantConfig) {
if($merchantConfig->getName() == $name) {
return $merchantConfig->getValue() ;
}
}
}

return false ;
}

public function getAddress(): ?Address
{
return $this->address;

Loading…
Cancel
Save