Last active
May 25, 2023 08:39
-
-
Save webdevilopers/5b0e90031b6a0c5da3bc to your computer and use it in GitHub Desktop.
Revisions
-
webdevilopers revised this gist
Aug 7, 2015 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,8 @@ class ContractAdminController extends Controller */ public function invoiceAction(Request $request) { // ... // $invoice = $this->get('contract.invoice'); $invoice = new Invoice($contract, $em->getRepository('PlusquamContractBundle:Contract')); } } -
webdevilopers revised this gist
Aug 7, 2015 . 1 changed file with 31 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ <?php namespace Plusquam\Bundle\ContractBundle\Service; use Doctrine\ORM\EntityRepository; class Invoice { private $repository; private $contract; private $filters; private $timeAndExpense; public function __construct($contract, EntityRepository $repository) { $this->contract = $contract; $this->repository = $repository; } public function setFilters($filters) { $this->filters = $filters; } public function getTimeAndExpense() { return $this->repository->getTimeAndExpenseByContract($this->filters); } } -
webdevilopers created this gist
Aug 7, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ <?php use Plusquam\Bundle\ContractBundle\Service\Invoice; class ContractAdminController extends Controller { /** * Invoice action * * @return Response */ public function invoiceAction(Request $request) { // ... $invoice = new Invoice($contract); } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ services: contract.repository: class: Doctrine\ORM\EntityRepository factory_service: doctrine.orm.entity_manager factory_method: getRepository arguments: - Plusquam\Bundle\ContractBundle\Entity\Contract contract.invoice: class: Plusquam\Bundle\ContractBundle\Service\Invoice arguments: - "@contract.repository"