本文整理汇总了PHP中Application_Model_Option::getLibraryId方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_Option::getLibraryId方法的具体用法?PHP Application_Model_Option::getLibraryId怎么用?PHP Application_Model_Option::getLibraryId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application_Model_Option
的用法示例。
在下文中一共展示了Application_Model_Option::getLibraryId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createDummyContents
public function createDummyContents($option_value, $design, $category)
{
$dummy_content_xml = $this->_getDummyXml($design, $category);
foreach ($dummy_content_xml->folders->folder as $folder) {
$root_category = new Folder_Model_Category();
$root_category->addData((array) $folder->category->main->content)->save();
if ($folder->category->main->features) {
$i = 1;
foreach ($folder->category->main->features->feature as $feature) {
$option = new Application_Model_Option();
$option->find((string) $feature->code, "code")->getObject();
$option_value_obj = new Application_Model_Option_Value();
$icon_id = NULL;
if ((string) $feature->icon) {
$icon = new Media_Model_Library_Image();
$icon->find((string) $feature->icon, "link");
if (!$icon->getData()) {
$icon->setLibraryId($option->getLibraryId())->setLink((string) $feature->icon)->setOptionId($option->getId())->setCanBeColorized($feature->colorizable ? (string) $feature->colorizable : 1)->setPosition(0)->save();
}
$icon_id = $icon->getId();
}
$datas = array("tabbar_name" => (string) $feature->name ? (string) $feature->name : NULL, "icon_id" => $icon_id, "app_id" => $this->getApplication()->getId(), "option_id" => $option->getId(), "layout_id" => $this->getApplication()->getLayout()->getId(), "folder_id" => $option_value->getId(), "folder_category_id" => $root_category->getId(), "folder_category_position" => $i++);
$option_value_obj->addData($datas)->save();
}
}
$this->unsData();
$this->setValueId($option_value->getId())->setRootCategoryId($root_category->getId())->save();
foreach ($folder->category->subcategory as $subcategory) {
$sub_root_category = new Folder_Model_Category();
$sub_root_category->addData((array) $subcategory->content)->setParentId($root_category->getId())->save();
if ($folder->category->subcategory->features) {
$i = 1;
foreach ($folder->category->subcategory->features->children() as $feature) {
$option = new Application_Model_Option();
$option->find((string) $feature->code, "code")->getObject();
$option_value_obj = new Application_Model_Option_Value();
$icon_id = NULL;
if ((string) $feature->icon) {
$icon = new Media_Model_Library_Image();
$icon->find((string) $feature->icon, "link");
if (!$icon->getData()) {
$icon->setLibraryId($option->getLibraryId())->setLink((string) $feature->icon)->setOptionId($option->getId())->setCanBeColorized(1)->setPosition(0)->save();
}
$icon_id = $icon->getId();
}
$datas = array("tabbar_name" => (string) $feature->name ? (string) $feature->name : NULL, "icon_id" => $icon_id, "app_id" => $this->getApplication()->getId(), "option_id" => $option->getId(), "layout_id" => $this->getApplication()->getLayout()->getId(), "folder_id" => $option_value->getId(), "folder_category_id" => $sub_root_category->getId(), "folder_category_position" => $i++);
$option_value_obj->addData($datas)->save();
}
}
}
}
}
示例2: array
foreach ($categories_designs as $category_code => $design_codes) {
$categories_designs_data = array("category_id" => $category_ids[$category_code]);
foreach ($design_codes as $design_code) {
$categories_designs_data["design_id"] = $design_ids[$design_code];
$this->_db->insert("template_design_category", $categories_designs_data);
}
}
// Assigning features to designs
$design_codes = array("dj" => array("newswall" => array("icon" => "/newswall/newswall2.png"), "music_gallery" => array("name" => "Playlists"), "push_notification" => array("name" => "Messages", "icon" => "/push_notifications/push2.png"), "image_gallery" => array("icon" => "/images/image5.png"), "facebook" => array(), "calendar" => array("icon" => "/calendar/calendar2.png"), "video_gallery" => array("icon" => "/videos/video2.png"), "custom_page" => array("name" => "About me"), "booking" => array("icon" => "/booking/booking4.png")), "fairground" => array("fanwall" => array("icon" => "/../../images/templates/fairground/icons/fanwall.png"), "loyalty" => array("name" => "Loyalty", "icon" => "/loyalty/loyalty4.png"), "social_gaming" => array("icon" => "/contest/contest4.png"), "discount" => array("name" => "Coupons", "icon" => "/discount/discount5.png"), "calendar" => array("icon" => "/calendar/calendar2.png"), "image_gallery" => array("icon" => "/images/image7.png"), "push_notification" => array("name" => "Push", "icon" => "/push_notifications/push3.png"), "video_gallery" => array(), "newswall" => array("name" => "News"), "facebook" => array()), "pizza" => array("m_commerce" => array("name" => "Orders"), "loyalty" => array("name" => "Loyalty"), "social_gaming" => array(), "discount" => array(), "facebook" => array(), "contact" => array()));
foreach ($design_codes as $design_code => $option_codes) {
foreach ($option_codes as $option_code => $option_infos) {
$design = new Template_Model_Design();
$design->find($design_code, "code");
$option = new Application_Model_Option();
$options = $option->findAll(array("code IN (?)" => $option_code));
foreach ($options as $option) {
$icon_id = NULL;
if (isset($option_infos["icon"])) {
$icon = new Media_Model_Library_Image();
$icon->find($option_infos["icon"], "link");
if (!$icon->getData()) {
$icon->setLibraryId($option->getLibraryId())->setLink($option_infos["icon"])->setOptionId($option->getId())->setCanBeColorized(1)->setPosition(0)->save();
}
$icon_id = $icon->getId();
}
$data = array("design_id" => $design->getId(), "option_id" => $option->getId(), "option_tabbar_name" => isset($option_infos["name"]) ? $option_infos["name"] : NULL, "option_icon" => $icon_id, "option_background_image" => isset($option_infos["background_image"]) ? $option_infos["background_image"] : NULL);
$design_content = new Template_Model_Design_Content();
$design_content->setData($data)->save();
}
}
}
示例3: array
$catalog_option->find('catalog', 'code');
$library = new Media_Model_Library();
if (!$catalog_option->getId()) {
$library->setName('Set Meal')->save();
$icon_paths = array('/catalog/catalog1.png', '/catalog/catalog2.png', '/catalog/catalog3.png', '/catalog/catalog4.png', '/catalog/catalog5.png', '/catalog/catalog6.png', '/catalog/catalog7.png', '/promotion/discount4.png', '/catalog/catalog8.png', '/catalog/catalog9.png', '/catalog/catalog10.png', '/catalog/catalog11.png');
$icon_id = 0;
foreach ($icon_paths as $key => $icon_path) {
$datas = array('library_id' => $library->getId(), 'link' => $icon_path, 'can_be_colorized' => 1);
$image = new Media_Model_Library_Image();
$image->setData($datas)->save();
if ($key == 0) {
$icon_id = $image->getId();
}
}
} else {
$library->find($catalog_option->getLibraryId());
$icons = $library->getIcons();
$icons->next();
$icon_id = $icons->current()->getId();
}
$datas = array('category_id' => $category->getId(), 'library_id' => $library->getId(), 'icon_id' => $icon_id, 'code' => 'set_meal', 'name' => 'Set Meal', 'model' => 'Catalog_Model_Product', 'desktop_uri' => 'catalog/application_menu/', 'mobile_uri' => 'catalog/mobile_setmeal_list/', "mobile_view_uri" => "catalog/mobile_setmeal_view/", "mobile_view_uri_parameter" => "set_meal_id", 'only_once' => 0, 'is_ajax' => 1, 'position' => 35, 'social_sharing_is_available' => 1);
$option = new Application_Model_Option();
$option->setData($datas)->save();
$set_meal_value_id = $option->getId();
$layout_data = array(array("value_id" => $catalog_value_id, "image_path" => "/customization/layout/catalog"), array("value_id" => $set_meal_value_id, "image_path" => "/customization/layout/set-meal"));
foreach ($layout_data as $data) {
$layouts = array();
$option = new Application_Model_Option();
$option->find($data["value_id"]);
foreach (array(1, 2, 3) as $layout_code) {
$layouts[] = array("code" => $layout_code, "option_id" => $option->getId(), "name" => "Layout {$layout_code}", "preview" => "{$data["image_path"]}/layout-{$layout_code}.png", "position" => $layout_code);