1 <?php
2
3 namespace Balance\Form\Search;
4
5 use Balance\Form\FormException;
6 use Balance\Model\Persistence\ValueOptionsInterface;
7 use Zend\Form\Form;
8 use Zend\ServiceManager\ServiceLocatorAwareInterface;
9 use Zend\ServiceManager\ServiceLocatorAwareTrait;
10
11 12 13
14 class Postings extends Form implements ServiceLocatorAwareInterface
15 {
16 use ServiceLocatorAwareTrait;
17
18 19 20
21 public function init()
22 {
23
24 $pAccounts = $this->getServiceLocator()->getServiceLocator()->get('Balance\Model\Persistence\Accounts');
25
26
27 if (! $pAccounts instanceof ValueOptionsInterface) {
28 throw new FormException('Invalid Model');
29 }
30
31
32 $this->add(array(
33 'type' => 'Text',
34 'name' => 'keywords',
35 'options' => array(
36 'label' => 'Palavras-Chave',
37 ),
38 ));
39
40
41 $this->add(array(
42 'type' => 'Select',
43 'name' => 'account_id',
44 'options' => array(
45 'label' => 'Conta',
46 'value_options' => $pAccounts->getValueOptions(),
47 ),
48 ));
49
50
51 $this->add(array(
52 'type' => 'DateTime',
53 'name' => 'datetime_begin',
54 'options' => array(
55 'label' => 'Data e Hora Inicial',
56 ),
57 ));
58
59
60 $this->add(array(
61 'type' => 'DateTime',
62 'name' => 'datetime_end',
63 'options' => array(
64 'label' => 'Data e Hora Final',
65 ),
66 ));
67 }
68 }
69