本文整理汇总了PHP中Doctrine\Common\Collections\ArrayCollection::getAffiliation方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayCollection::getAffiliation方法的具体用法?PHP ArrayCollection::getAffiliation怎么用?PHP ArrayCollection::getAffiliation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\Common\Collections\ArrayCollection
的用法示例。
在下文中一共展示了ArrayCollection::getAffiliation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param ArrayCollection $doa
*/
public function __construct(ArrayCollection $doa, ContactService $contactService)
{
parent::__construct();
$this->setAttribute('method', 'post');
$this->setAttribute('action', '');
$this->setAttribute('class', 'form-horizontal');
/*
* Create a fieldSet per DOA (and affiliation)
*/
foreach ($doa as $doa) {
$affiliationFieldset = new Fieldset('affiliation_' . $doa->getAffiliation()->getId());
$contactService->findContactsInAffiliation($doa->getAffiliation());
$affiliationFieldset->add(['type' => 'Zend\\Form\\Element\\Select', 'name' => 'contact', 'options' => ['value_options' => $contactService->toFormValueOptions(), 'label' => _("txt-contact-name")], 'attributes' => ['class' => 'form-control', 'id' => 'contact-' . $doa->getId(), 'required' => true]]);
$affiliationFieldset->add(['type' => 'Zend\\Form\\Element\\Text', 'name' => 'dateSigned', 'attributes' => ['class' => 'form-control', 'id' => 'dateSigned-' . $doa->getId(), 'required' => true]]);
$this->add($affiliationFieldset);
}
$this->add(['type' => 'Zend\\Form\\Element\\Submit', 'name' => 'submit', 'attributes' => ['class' => "btn btn-primary", 'value' => _("txt-update")]]);
$this->add(['type' => 'Zend\\Form\\Element\\Submit', 'name' => 'cancel', 'attributes' => ['class' => "btn btn-warning", 'value' => _("txt-cancel")]]);
}