本文整理匯總了PHP中CustomFields::setScreen方法的典型用法代碼示例。如果您正苦於以下問題:PHP CustomFields::setScreen方法的具體用法?PHP CustomFields::setScreen怎麽用?PHP CustomFields::setScreen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CustomFields
的用法示例。
在下文中一共展示了CustomFields::setScreen方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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');
}
示例2: _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->setScreen($row[self::DB_FIELDS_SCREEN]);
$tmp->setExtraData($row[self::DB_FIELDS_EXTRA_DATA]);
return $tmp;
}