Skip to content

Commit

Permalink
added paymenttype
Browse files Browse the repository at this point in the history
  • Loading branch information
peillis committed Feb 3, 2012
1 parent 5191820 commit bb2023a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Siwapp/InvoiceBundle/Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function paymentsAction($invoiceId)
// Return all payments
$em = $this->getDoctrine()->getEntityManager();
$entities = $em->getRepository('SiwappInvoiceBundle:Payment')->findBy(array('invoice' => $invoiceId));

return array('entities' => $entities, 'invoiceId' => $invoiceId);
}

Expand Down
31 changes: 31 additions & 0 deletions src/Siwapp/InvoiceBundle/Form/PaymentType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Siwapp\InvoiceBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;


class PaymentType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('date')
->add('amount')
->add('notes')
;
}

public function getDefaultOptions(array $options)
{
return array(
'data_class' => 'Siwapp\InvoiceBundle\Entity\Payment',
);
}

public function getName()
{
return 'siwapp_invoicebundle_paymenttype';
}
}

0 comments on commit bb2023a

Please sign in to comment.