本文整理匯總了PHP中Prefs::getShopCategory方法的典型用法代碼示例。如果您正苦於以下問題:PHP Prefs::getShopCategory方法的具體用法?PHP Prefs::getShopCategory怎麽用?PHP Prefs::getShopCategory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Prefs
的用法示例。
在下文中一共展示了Prefs::getShopCategory方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: beforeUpdate
public function beforeUpdate($id, $data)
{
if (isset($data['file_id']) && count($data['file_id'])) {
$mediaindex = 0;
for ($i = 0; $i < count($data['thumbnail_url']); $i++) {
$index = $mediaindex;
$data['files'][$data['file_id'][$i]]['ns'] = $data['ns'][$i];
$data['files'][$data['file_id'][$i]]['role'] = $data['role'][$i];
$data['files'][$data['file_id'][$i]]['thumbnail_url'] = $data['thumbnail_url'][$i];
$data['files'][$data['file_id'][$i]]['large_url'] = $data['large_url'][$i];
$data['files'][$data['file_id'][$i]]['medium_url'] = $data['medium_url'][$i];
$data['files'][$data['file_id'][$i]]['full_url'] = $data['full_url'][$i];
$data['files'][$data['file_id'][$i]]['delete_type'] = $data['delete_type'][$i];
$data['files'][$data['file_id'][$i]]['delete_url'] = $data['delete_url'][$i];
$data['files'][$data['file_id'][$i]]['filename'] = $data['filename'][$i];
$data['files'][$data['file_id'][$i]]['filesize'] = $data['filesize'][$i];
$data['files'][$data['file_id'][$i]]['temp_dir'] = $data['temp_dir'][$i];
$data['files'][$data['file_id'][$i]]['filetype'] = $data['filetype'][$i];
$data['files'][$data['file_id'][$i]]['is_image'] = $data['is_image'][$i];
$data['files'][$data['file_id'][$i]]['is_audio'] = $data['is_audio'][$i];
$data['files'][$data['file_id'][$i]]['is_video'] = $data['is_video'][$i];
$data['files'][$data['file_id'][$i]]['fileurl'] = $data['fileurl'][$i];
$data['files'][$data['file_id'][$i]]['file_id'] = $data['file_id'][$i];
$data['files'][$data['file_id'][$i]]['sequence'] = $mediaindex;
$mediaindex++;
$data['defaultpic'] = $data['file_id'][0];
$data['defaultpictures'] = $data['files'][$data['file_id'][0]];
}
} else {
$data['defaultpic'] = '';
$data['defaultpictures'] = '';
}
if (!isset($data['shortcode']) || $data['shortcode'] == '') {
$data['shortcode'] = str_random(5);
}
$cats = Prefs::getShopCategory()->shopcatToSelection('slug', 'name', false);
$data['shopcategory'] = $cats[$data['shopcategoryLink']];
return $data;
}
示例2: postAssignshopcat
public function postAssignshopcat()
{
$in = Input::get();
$category = $in['category'];
$cats = Prefs::getShopCategory()->ShopCatToSelection('slug', 'name', false);
$product_ids = $in['product_ids'];
foreach ($product_ids as $p) {
$prop = Member::find($p);
$prop->shopcategory = $cats[$category];
$prop->shopcategoryLink = $category;
$prop->save();
}
return Response::json(array('result' => 'OK'));
}