本文整理汇总了PHP中FrmForm::getIdByKey方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmForm::getIdByKey方法的具体用法?PHP FrmForm::getIdByKey怎么用?PHP FrmForm::getIdByKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmForm
的用法示例。
在下文中一共展示了FrmForm::getIdByKey方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_form_update_with_ajax
/**
* @covers FrmFormsController::update
* with ajax
*/
function test_form_update_with_ajax()
{
$form_id = FrmForm::getIdByKey($this->contact_form_key);
self::_setup_post_values($form_id);
try {
$this->_handleAjax('frm_save_form');
} catch (WPAjaxDieStopException $e) {
unset($e);
// Expected to return form successfully updated message
}
self::_check_updated_values($form_id);
}
示例2: test_get_all_for_form
/**
* @covers FrmField::get_all_for_form
*/
function test_get_all_for_form()
{
$forms = array('basic_test' => array('form_key' => $this->contact_form_key, 'count' => 8), 'repeat' => array('form_key' => $this->all_fields_form_key, 'count' => 33 + 3), 'no_repeat_or_embed' => array('form_key' => $this->all_fields_form_key, 'count' => 33), 'repeat_and_embed' => array('form_key' => $this->all_fields_form_key, 'count' => 33 + 3 + 8));
foreach ($forms as $test => $args) {
$form_id = FrmForm::getIdByKey($args['form_key']);
if ($test == 'no_repeat_or_embed') {
$fields = FrmField::get_all_for_form($form_id, '', 'exclude', 'exclude');
} else {
if ($test == 'repeat_and_embed') {
$fields = FrmField::get_all_for_form($form_id, '', 'include', 'include');
} else {
$fields = FrmField::get_all_for_form($form_id);
}
}
$this->assertNotEmpty($fields);
$this->assertEquals($args['count'], count($fields), 'An incorrect number of fields are retrieved with FrmField::get_all_for_form.');
}
}
示例3: get_id_by_key
function get_id_by_key($form_key)
{
return FrmForm::getIdByKey($form_key);
}
示例4: test_get_all_for_form
/**
* @covers FrmField::get_all_for_form
*/
function test_get_all_for_form()
{
$form_id = FrmForm::getIdByKey($this->contact_form_key);
$fields = $this->factory->field->get_fields_from_form($form_id);
$this->assertNotEmpty($fields);
}
示例5: _check_xml_updated_number_of_entries
function _check_xml_updated_number_of_entries($args)
{
$parent_entries = FrmEntry::getAll(array('form_id' => $args['parent_form_id']));
$this->assertEquals(count($args['parent_entries']), count($parent_entries), 'The number of entries in form ' . $args['parent_form_id'] . ' should be the same after an XML update.');
$rep_sec_form_id = FrmForm::getIdByKey($this->repeat_sec_form_key);
$child_entries = FrmEntry::getAll(array('form_id' => $rep_sec_form_id));
$this->assertEquals(count($args['child_entries']), count($child_entries), 'The number of entries in form ' . $rep_sec_form_id . ' should be the same after an XML update.');
$embed_form_id = FrmForm::getIdByKey($this->contact_form_key);
$embedded_entries = FrmEntry::getAll(array('form_id' => $embed_form_id, 'parent_item_id !' => 0));
$this->assertEquals(count($args['embedded_entries']), count($embedded_entries), 'The number of entries in the embedded form should be the same after an XML update.');
}
示例6: _get_xml_update_args
function _get_xml_update_args()
{
$parent_form_id = FrmForm::getIdByKey($this->all_fields_form_key);
$repeating_section_id = FrmField::get_id_by_key('repeating-section');
$all_fields = FrmField::get_all_for_form($parent_form_id, '', 'include', 'include');
$repeating_section = FrmField::getOne($repeating_section_id);
$rep_sec_form = FrmForm::getOne($repeating_section->field_options['form_select']);
$repeating_fields = FrmField::get_all_for_form($repeating_section->field_options['form_select']);
$args = array('parent_form_id' => $parent_form_id, 'repeating_section' => $repeating_section, 'all_fields' => $all_fields, 'rep_sec_form' => $rep_sec_form, 'repeating_fields' => $repeating_fields);
return $args;
}