本文整理匯總了PHP中Doctrine\Common\Collections\ArrayCollection::getId方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArrayCollection::getId方法的具體用法?PHP ArrayCollection::getId怎麽用?PHP ArrayCollection::getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\Common\Collections\ArrayCollection
的用法示例。
在下文中一共展示了ArrayCollection::getId方法的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")]]);
}