当前位置: 首页>>代码示例>>PHP>>正文


PHP CustomFields::setExtraData方法代码示例

本文整理汇总了PHP中CustomFields::setExtraData方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomFields::setExtraData方法的具体用法?PHP CustomFields::setExtraData怎么用?PHP CustomFields::setExtraData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CustomFields的用法示例。


在下文中一共展示了CustomFields::setExtraData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Delete custom fields
  * @param $request
  * @return unknown_type
  */
 public function execute($request)
 {
     $admin = $this->getUser()->hasCredential(Auth::ADMIN_ROLE);
     if (!$admin) {
         $this->forward("auth", "unauthorized");
         return;
     }
     $form = new CustomFieldForm(array(), array(), true);
     $customFieldsService = $this->getCustomFieldService();
     if ($request->isMethod('post')) {
         $form->bind($request->getParameter($form->getName()));
         if ($form->isValid()) {
             $fieldNum = $form->getValue('field_num');
             $customField = null;
             if (isset($fieldNum)) {
                 $customField = $customFieldsService->readCustomField($fieldNum);
             }
             if (empty($customField)) {
                 $customField = new CustomFields();
             }
             $customField->setName($form->getValue('name'));
             $customField->setType($form->getValue('type'));
             $customField->setScreen($form->getValue('screen'));
             $customField->setExtraData($form->getValue('extra_data'));
             $customFieldsService->saveCustomField($customField);
             $this->getUser()->setFlash('templateMessage', array('success', __(TopLevelMessages::SAVE_SUCCESS)));
         }
     }
     $this->redirect('pim/listCustomFields');
 }
开发者ID:rabbitdigital,项目名称:HRM,代码行数:35,代码来源:defineCustomFieldAction.class.php

示例2: 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);
     }
 }
开发者ID:rabbitdigital,项目名称:HRM,代码行数:15,代码来源:CustomFieldsDaoTest.php

示例3: parseEditData

 function parseEditData($postArr)
 {
     $field = new CustomFields();
     if (isset($postArr['txtId'])) {
         $field->setFieldNumber(trim($postArr['txtId']));
         $field->setName(trim($postArr['txtFieldName']));
         $field->setFieldType(trim($postArr['cmbFieldType']));
         if ($field->getFieldType() == CustomFields::FIELD_TYPE_SELECT) {
             $field->setExtraData(trim($postArr['txtExtra']));
         }
     }
     return $field;
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:13,代码来源:EXTRACTOR_CustomFields.php

示例4: 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);
     }
 }
开发者ID:rabbitdigital,项目名称:HRM,代码行数:18,代码来源:CustomFieldsServiceTest.php

示例5: _createFromRow

 /**
  * Creates a CustomFields object from a resultset row
  *
  * @param array $row Resultset row from the database.
  * @return CustomFields Custom Fields object.
  */
 private static function _createFromRow($row)
 {
     $tmp = new CustomFields();
     $tmp->setFieldNumber($row[self::DB_FIELDS_NUM]);
     $tmp->setName($row[self::DB_FIELDS_NAME]);
     $tmp->setFieldType($row[self::DB_FIELDS_TYPE]);
     $tmp->setExtraData($row[self::DB_FIELDS_EXTRA_DATA]);
     return $tmp;
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:15,代码来源:CustomFields.php

示例6: 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();
 }
开发者ID:rabbitdigital,项目名称:HRM,代码行数:20,代码来源:actions.class.bak.php


注:本文中的CustomFields::setExtraData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。