/** * Produce a form element. * * @param Affiliation $affiliation * @param ProjectService $projectService */ public function __construct(Affiliation $affiliation, ProjectService $projectService) { parent::__construct($affiliation->getId()); foreach ($projectService->parseEditYearRange() as $year) { $fieldSet = new Fieldset($year); $fieldSet->add(['type' => 'Zend\\Form\\Element\\Text', 'name' => 'cost', 'attributes' => ['class' => 'form-control cost-input year-' . $year, 'label' => 'cost', 'placeholder' => _("txt-cost")]]); $this->add($fieldSet); } }
/** * @return bool */ public function isEmpty() { return is_null($this->affiliation) || is_null($this->affiliation->getId()); }