本文整理汇总了PHP中Application_Model_Option::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_Option::getId方法的具体用法?PHP Application_Model_Option::getId怎么用?PHP Application_Model_Option::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application_Model_Option
的用法示例。
在下文中一共展示了Application_Model_Option::getId方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: findAction
public function findAction()
{
$previews = new Preview_Model_Preview();
$data = array();
if ($this->getRequest()->getParam("preview_id")) {
$previews = $previews->findAll(array("aop.preview_id" => $this->getRequest()->getParam("preview_id")));
$data_tmp = array();
foreach ($previews as $preview) {
if ($preview->getlibraryId()) {
$images = $preview->findImages();
$images_data = array();
foreach ($images as $image) {
$images_data[] = array("id" => $image->getImageId(), "link" => $image->getlink(), "new" => 0, "to_delete" => 0);
}
}
if ($preview->getPreviewId()) {
$data_tmp[$preview->getLanguageCode()] = array("title" => $preview->getTitle(), "description" => $preview->getDescription(), "language_code" => $preview->getLanguageCode(), "from_database" => 1, "images" => $images_data);
}
}
if (!empty($data_tmp)) {
$data["previews"] = $data_tmp;
}
$data["section_title_one"] = $this->_("Edit the preview");
} else {
$data["section_title_one"] = $this->_("Create a new preview");
$option = new Application_Model_Option();
$option_list = array();
$options = $option->findAll(array(), 'position ASC');
foreach ($options as $option) {
$option_list[$option->getId()] = $option->getName();
}
$data["options"] = $option_list;
}
$data["section_title_two"] = $this->_("Preview images");
$languages = Core_Model_Language::getLanguages();
$language_list = array();
foreach ($languages as $language) {
$language_list[$language->getCode()] = $language->getName();
}
$data["languages"] = $language_list;
$data["current_language"] = Core_Model_Language::getCurrentLanguage();
$this->_sendHtml($data);
}
示例3: findaccessAction
public function findaccessAction()
{
if ($data = Zend_Json::decode($this->getRequest()->getRawBody())) {
try {
if (empty($data["admin_id"]) or empty($data["app_id"])) {
throw new Exception($this->_("An error occurred while saving. Please try again later."));
}
$admin = new Admin_Model_Admin();
$admin->find($data["admin_id"]);
$app = new Application_Model_Application();
$app->find($data["app_id"]);
$app_acl_option = new Application_Model_Acl_Option();
$forbidden_options = $app_acl_option->findAllByAppId($data["app_id"], $data["admin_id"]);
$option_tmp = array();
foreach ($forbidden_options as $option) {
$option_tmp[] = $option->getValueId();
}
$forbidden_options = $option_tmp;
$data = array("app_name" => $app->getName(), "user_name" => $admin->getData("firstname") . " " . $admin->getData("lastname"), "can_add_page" => $admin->isAllowedToAddPages($data["app_id"]), "options" => array());
foreach ($app->getOptions() as $option) {
$option_is_allowed = !in_array($option->getValueId(), $forbidden_options);
$option_obj = new Application_Model_Option();
$option_obj->find($option->getOptionId());
if ($option_obj->getId()) {
$icon_url = $option_obj->getIconUrl();
} else {
$icon_url = null;
}
$data["options"][] = array("value_id" => $option->getValueId(), "icon_url" => $icon_url, "name" => $option->getTabbarName() ? $option->getTabbarName() : $option->getName(), "code" => $option->getCode(), "is_allowed" => $option_is_allowed);
}
} catch (Exception $e) {
$data = array("error" => 1, "message" => $e->getMessage());
}
$this->_sendHtml($data);
}
}
示例4: int
<?php
$this->query("\n CREATE TABLE `wordpress` (\n `wp_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n `value_id` int(11) unsigned NOT NULL,\n `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',\n `created_at` datetime NOT NULL,\n `updated_at` datetime NOT NULL,\n PRIMARY KEY (`wp_id`),\n KEY `KEY_VALUE_ID` (`value_id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\n CREATE TABLE `wordpress_category` (\n `category_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n `wp_id` int(11) unsigned NOT NULL,\n `wp_category_id` int(11) NOT NULL,\n `position` tinyint(1) unsigned NOT NULL DEFAULT '0',\n PRIMARY KEY (`category_id`),\n KEY `KEY_WP_ID` (`wp_id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$this->query("\n ALTER TABLE `wordpress`\n ADD FOREIGN KEY `FK_VALUE_ID` (`value_id`) REFERENCES `application_option_value` (`value_id`) ON DELETE CASCADE ON UPDATE CASCADE;\n");
$this->query("\n ALTER TABLE `wordpress_category`\n ADD FOREIGN KEY `FK_WP_ID` (`wp_id`) REFERENCES `wordpress` (`wp_id`) ON DELETE CASCADE ON UPDATE CASCADE;\n");
$library = new Media_Model_Library();
$library->setName('Wordpress')->save();
$icon_paths = array('/wordpress/wordpress1.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();
}
}
$category = new Application_Model_Option_Category();
$category->find("integration", "code");
$data = array('category_id' => $category->getId(), 'library_id' => $library->getId(), 'icon_id' => $icon_id, 'code' => "wordpress", 'name' => "Wordpress", 'model' => "Wordpress_Model_Wordpress", 'desktop_uri' => "wordpress/application/", 'mobile_uri' => "wordpress/mobile_list/", 'only_once' => 0, 'is_ajax' => 1, 'position' => 170, 'social_sharing_is_available' => 1);
$option = new Application_Model_Option();
$option->setData($data)->save();
$layouts = array();
foreach (array(1, 2, 3) as $layout_code) {
$layouts[] = array("code" => $layout_code, "option_id" => $option->getId(), "name" => "Layout {$layout_code}", "preview" => "/customization/layout/wordpress/layout-{$layout_code}.png", "position" => $layout_code);
}
foreach ($layouts as $data) {
$this->_db->insert("application_option_layout", $data);
}
示例5: int
$this->query("\n CREATE TABLE `promotion` (\n `promotion_id` int(11) NOT NULL AUTO_INCREMENT,\n `value_id` int(11) unsigned NOT NULL,\n `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n `picture` VARCHAR(255) NULL DEFAULT NULL,\n `description` text COLLATE utf8_unicode_ci NOT NULL,\n `conditions` varchar(100) COLLATE utf8_unicode_ci NOT NULL,\n `is_unique` tinyint(1) NOT NULL DEFAULT '0',\n `end_at` date DEFAULT NULL,\n `force_validation` tinyint(1) unsigned NOT NULL DEFAULT '0',\n `is_active` tinyint(1) NOT NULL DEFAULT '1',\n `condition_type` varchar(9) COLLATE utf8_unicode_ci DEFAULT NULL,\n `condition_number_of_points` tinyint(2) DEFAULT NULL,\n `condition_period_number` tinyint(2) DEFAULT NULL,\n `condition_period_type` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,\n `is_shared` tinyint(1) NOT NULL DEFAULT '0',\n `owner` tinyint(1) NOT NULL DEFAULT '1',\n `unlock_by` enum('account', 'qrcode') NOT NULL DEFAULT 'account',\n `unlock_code` VARCHAR(10) NULL DEFAULT NULL,\n `created_at` datetime NOT NULL,\n `updated_at` datetime NOT NULL,\n PRIMARY KEY (`promotion_id`),\n KEY `KEY_VALUE_ID` (`value_id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\n CREATE TABLE `promotion_customer` (\n `promotion_customer_id` int(11) NOT NULL AUTO_INCREMENT,\n `promotion_id` int(11) NOT NULL,\n `pos_id` int(11) DEFAULT NULL,\n `customer_id` int(11) UNSIGNED NOT NULL,\n `is_used` tinyint(1) unsigned NOT NULL DEFAULT '0',\n `number_of_error` tinyint(1) unsigned NOT NULL DEFAULT '0',\n `created_at` datetime NOT NULL,\n `last_error` datetime DEFAULT NULL,\n PRIMARY KEY (`promotion_customer_id`),\n KEY `KEY_PROMOTION_ID` (`promotion_id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$this->query("\n ALTER TABLE `promotion`\n ADD FOREIGN KEY `FK_VALUE_ID` (`value_id`) REFERENCES `application_option_value` (`value_id`) ON DELETE CASCADE ON UPDATE CASCADE;\n");
$this->query("\n ALTER TABLE `promotion_customer`\n ADD FOREIGN KEY `FK_PROMOTION_ID` (`promotion_id`) REFERENCES `promotion` (`promotion_id`) ON DELETE CASCADE ON UPDATE CASCADE;\n");
$library = new Media_Model_Library();
$library->setName('Discount')->save();
$icon_paths = array('/discount/discount1.png', '/discount/discount2.png', '/discount/discount3.png', '/discount/discount4.png', '/discount/discount5.png', '/loyalty/loyalty6.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();
}
}
$datas = array('library_id' => $library->getId(), 'icon_id' => $icon_id, 'code' => 'discount', 'name' => 'Discount', 'model' => 'Promotion_Model_Promotion', 'desktop_uri' => 'promotion/application/', 'mobile_uri' => "promotion/mobile_list/", 'only_once' => 0, 'is_ajax' => 1, 'position' => 20, 'social_sharing_is_available' => 1);
$option = new Application_Model_Option();
$option->setData($datas)->save();
$layouts = array(array("code" => 1, "option_id" => $option->getId(), "name" => "Layout 1", "preview" => "/customization/layout/promotion/layout-1.png", "position" => 1), array("code" => 2, "option_id" => $option->getId(), "name" => "Layout 2", "preview" => "/customization/layout/promotion/layout-2.png", "position" => 2));
foreach ($layouts as $data) {
$this->_db->insert("application_option_layout", $data);
}
$media_library = new Media_Model_Library();
$media_library->find("Code Scan", "name");
$last_icon = count($media_library->getIcons()) - 1;
$icons = $media_library->getIcons();
$icon_id = $icons[$last_icon]->getId();
$option = new Application_Model_Option();
$all_options = $option->findAll("", "position DESC");
$option_data = array("code" => "qr_discount", "name" => "QR Coupons", "model" => "Promotion_Model_Promotion", "library_id" => $media_library->getId(), "icon_id" => $icon_id, "desktop_uri" => "promotion/application/", "mobile_uri" => "promotion/mobile_list/", "position" => 25);
$option->setData($option_data)->save();
示例6: setbackgroundimageAction
public function setbackgroundimageAction()
{
if ($datas = $this->getRequest()->getPost()) {
try {
$option_value = new Application_Model_Option_Value();
$option_value->find($datas['option_id']);
if (!$option_value->getId()) {
throw new Exception($this->_("An error occurred while saving your picture. Please try againg later."));
}
// Récupère l'option
$option = new Application_Model_Option();
$option->find($option_value->getOptionId());
$save_path = '/feature/' . $option->getId() . '/background/';
$relative_path = Application_Model_Application::getImagePath() . $save_path;
$folder = Application_Model_Application::getBaseImagePath() . $save_path;
$datas['dest_folder'] = $folder;
$uploader = new Core_Model_Lib_Uploader();
$file = $uploader->savecrop($datas);
$option_value->setBackgroundImage($save_path . $file)->save();
$datas = array('success' => 1, 'file' => $relative_path . $file);
} catch (Exception $e) {
$datas = array('error' => 1, 'message' => $e->getMessage());
}
$this->getLayout()->setHtml(Zend_Json::encode($datas));
}
}
示例7: varchar
<?php
$fields = array_keys($this->_db->describeTable("application_option"));
if (!in_array("mobile_view_uri", $fields)) {
$this->query("\n ALTER TABLE `application_option` ADD `mobile_view_uri` varchar(100) NULL DEFAULT NULL AFTER `mobile_uri`;\n ALTER TABLE `application_option` ADD `mobile_view_uri_parameter` varchar(100) NULL DEFAULT NULL AFTER `mobile_view_uri`;\n ");
}
$mobile_view_uris = array("booking" => array("mobile_view_uri" => "booking/mobile_view/", "mobile_view_uri_parameter" => null), "calendar" => array("mobile_view_uri" => "event/mobile_view/", "mobile_view_uri_parameter" => "event_id"), "catalog" => array("mobile_view_uri" => "catalog/mobile_category_product_view/", "mobile_view_uri_parameter" => "product_id"), "custom_page" => array("mobile_view_uri" => "cms/mobile_page_view/", "mobile_view_uri_parameter" => null), "discount" => array("mobile_view_uri" => "promotion/mobile_view/", "mobile_view_uri_parameter" => "promotion_id"), "fanwall" => array("mobile_view_uri" => "comment/mobile_view/", "mobile_view_uri_parameter" => "comment_id"), "image_gallery" => array("mobile_view_uri" => "media/mobile_gallery_image_view/", "mobile_view_uri_parameter" => "gallery_id,offset/0"), "m_commerce" => array("mobile_view_uri" => "mcommerce/mobile_product/", "mobile_view_uri_parameter" => "product_id"), "music_gallery" => array("mobile_view_uri" => "media/mobile_api_music_playlist/", "mobile_view_uri_parameter" => "playlist_id"), "newswall" => array("mobile_view_uri" => "comment/mobile_view/", "mobile_view_uri_parameter" => "comment_id"), "qr_discount" => array("mobile_view_uri" => "promotion/mobile_view/", "mobile_view_uri_parameter" => "promotion_id"), "rss_feed" => array("mobile_view_uri" => "rss/mobile_feed_view/", "mobile_view_uri_parameter" => "feed_id"), "set_meal" => array("mobile_view_uri" => "catalog/mobile_setmeal_view/", "mobile_view_uri_parameter" => "set_meal_id"), "video_gallery" => array("mobile_view_uri" => "media/mobile_gallery_video_view/", "mobile_view_uri_parameter" => "gallery_id,offset/1"));
foreach ($mobile_view_uris as $option_code => $option_uris) {
$application_option = new Application_Model_Option();
$application_option->find($option_code, "code");
if ($application_option->getId()) {
$application_option->setMobileViewUri($option_uris["mobile_view_uri"]);
$application_option->setMobileViewUriParameter($option_uris["mobile_view_uri_parameter"]);
$application_option->save();
}
}
示例8: 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();
}
}
}
示例9: foreach
$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);
}
foreach ($layouts as $data) {
$this->_db->insert("application_option_layout", $data);
}
}
示例10: getPage
public function getPage($code)
{
$dummy = new Application_Model_Option();
$dummy->find($code, 'code');
$page_sought = new Application_Model_Option_Value();
return $page_sought->find(array('option_id' => $dummy->getId()));
}
示例11: array
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();
}
}
$datas = array('library_id' => $library->getId(), 'icon_id' => $icon_id, 'code' => 'catalog', 'name' => 'Catalog', 'model' => 'Catalog_Model_Category', 'desktop_uri' => 'catalog/application/', 'mobile_uri' => 'catalog/mobile_category_list/', "mobile_view_uri" => "catalog/mobile_category_product_view/", "mobile_view_uri_parameter" => "product_id", 'only_once' => 0, 'is_ajax' => 1, 'position' => 30, 'social_sharing_is_available' => 1);
$option = new Application_Model_Option();
$option->setData($datas)->save();
// SET MEAL
$catalog_option = new Application_Model_Option();
$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();