本文整理汇总了PHP中CustomFields::setFieldNum方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomFields::setFieldNum方法的具体用法?PHP CustomFields::setFieldNum怎么用?PHP CustomFields::setFieldNum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomFields
的用法示例。
在下文中一共展示了CustomFields::setFieldNum方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSaveCustomField
/**
* Testing saveCustomField
*/
public function testSaveCustomField()
{
foreach ($this->testCases['CustomFields'] as $k => $v) {
$customFields = new CustomFields();
$customFields->setFieldNum($v['field_num']);
$customFields->setName($v['name']);
$customFields->setType($v['type']);
$customFields->setExtraData($v['extra_data']);
$result = $this->customFieldsDao->saveCustomField($customFields);
$this->assertTrue($result);
}
}
示例2: testReadCustomField
/**
* Testing readCustomField
*/
public function testReadCustomField()
{
foreach ($this->testCases['CustomFields'] as $k => $v) {
$customFields = new CustomFields();
$customFields->setFieldNum($v['field_num']);
$customFields->setName($v['name']);
$customFields->setType($v['type']);
$customFields->setExtraData($v['extra_data']);
$this->customFieldsDao = $this->getMock('CustomFieldsDao');
$this->customFieldsDao->expects($this->once())->method('readCustomField')->will($this->returnValue($customFields));
$this->customFieldsService->setCustomFieldsDao($this->customFieldsDao);
$result = $this->customFieldsService->readCustomField($v['field_num']);
$this->assertTrue($result instanceof CustomFields);
}
}
示例3: executeSaveCustomFields
/**
* Save Custom fields
* @param sfWebRequest $request
* @return unknown_type
*/
public function executeSaveCustomFields(sfWebRequest $request)
{
$customFieldsService = new CustomFieldsService();
if ($request->isMethod('post')) {
$customFields = new CustomFields();
$customFields->setFieldNum($request->getParameter('txtId'));
$customFields->setName($request->getParameter('txtName'));
$customFields->setType($request->getParameter('cmbType'));
$customFields->setExtraData($request->getParameter('txtExtra'));
$customFieldsService->saveCustomField($customFields);
$this->setMessage('SUCCESS', array(TopLevelMessages::SAVE_SUCCESS));
$this->redirect('admin/listCustomFields');
}
$this->avaliableIds = $customFieldsService->getAvaliableFieldNumbers();
}