Skip to content

Commit

Permalink
String billing plan
Browse files Browse the repository at this point in the history
  • Loading branch information
Bordovsky committed Aug 2, 2016
1 parent 0ebb80d commit fbd8ec8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Twig/FullPriceExtension.php
Expand Up @@ -5,6 +5,7 @@

namespace Trinity\Component\Utils\Twig;

use Necktie\PaymentBundle\Entity\BillingPlan;
use Trinity\Component\Utils\Services\PriceStringGenerator;


Expand Down Expand Up @@ -34,9 +35,23 @@ public function getFunctions() : array
{
return [
new \Twig_SimpleFunction('fullPrice', [$this, 'fullPrice']),
new \Twig_SimpleFunction('fullPriceByPlan', [$this, 'fullPriceByPlan']),
];
}

/**
* @param BillingPlan $plan
*
* @return string
* @throws \Symfony\Component\Intl\Exception\MethodArgumentNotImplementedException
* @throws \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException
* @throws \Trinity\Bundle\SettingsBundle\Exception\PropertyNotExistsException
*
*/
public function fullPriceByPlan(BillingPlan $plan) :string
{
return $this->generator->generateFullPriceStr($plan);
}

/**
* @param int $initialPrice
Expand Down

0 comments on commit fbd8ec8

Please sign in to comment.