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


PHP Application_Model_Option::setData方法代码示例

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


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

示例1: int

<?php

$this->query("\n    CREATE TABLE `push_apns_devices` (\n        `device_id` int(11) NOT NULL AUTO_INCREMENT,\n        `app_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n        `app_version` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,\n        `device_uid` varchar(50) COLLATE utf8_unicode_ci NOT NULL,\n        `last_known_latitude` decimal(11,8) DEFAULT NULL,\n        `last_known_longitude` decimal(11,8) DEFAULT NULL,\n        `device_token` char(64) COLLATE utf8_unicode_ci NOT NULL,\n        `device_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n        `device_model` varchar(100) COLLATE utf8_unicode_ci NOT NULL,\n        `device_version` varchar(25) COLLATE utf8_unicode_ci NOT NULL,\n        `push_badge` enum('disabled','enabled') COLLATE utf8_unicode_ci DEFAULT 'disabled',\n        `push_alert` enum('disabled','enabled') COLLATE utf8_unicode_ci DEFAULT 'disabled',\n        `push_sound` enum('disabled','enabled') COLLATE utf8_unicode_ci DEFAULT 'disabled',\n        `status` enum('active','uninstalled') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',\n        `created_at` datetime NOT NULL,\n        `updated_at` timestamp NOT NULL,\n        PRIMARY KEY (`device_id`),\n        UNIQUE KEY `UNIQUE_KEY_APP_NAME_APP_VERSION_DEVICE_UID` (`app_name`,`app_version`,`device_uid`),\n        KEY `KEY_DEVICE_TOKEN` (`device_token`),\n        KEY `KEY_STATUS` (`status`)\n    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\n    CREATE TABLE `push_delivered_message` (\n        `deliver_id` int(11) NOT NULL AUTO_INCREMENT,\n        `device_id` int(11) NOT NULL,\n        `device_uid` text COLLATE utf8_unicode_ci NOT NULL,\n        `device_type` tinyint(1) NOT NULL,\n        `message_id` int(11) NOT NULL,\n        `status` tinyint(1) NOT NULL DEFAULT '0',\n        `is_read` tinyint(1) NOT NULL DEFAULT '0',\n        `is_displayed` int(11) NOT NULL DEFAULT '0',\n        `delivered_at` datetime NOT NULL,\n        PRIMARY KEY (`deliver_id`),\n        KEY `KEY_DEVICE_ID` (`device_id`)\n    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$this->query("\n    CREATE TABLE `push_gcm_devices` (\n        `device_id` int(11) NOT NULL AUTO_INCREMENT,\n        `app_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n        `registration_id` text COLLATE utf8_unicode_ci,\n        `development` enum('production','sandbox') CHARACTER SET latin1 NOT NULL DEFAULT 'production',\n        `status` enum('active','uninstalled') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',\n        `created_at` datetime NOT NULL,\n        `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,\n        PRIMARY KEY (`device_id`)\n    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\n    CREATE TABLE `push_messages` (\n        `message_id` int(11) NOT NULL AUTO_INCREMENT,\n        `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL,\n        `text` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n        `latitude` decimal(11,8) DEFAULT NULL,\n        `longitude` decimal(11,8) DEFAULT NULL,\n        `radius` decimal(7,2) DEFAULT NULL,\n        `send_at` datetime DEFAULT NULL,\n        `send_until` datetime DEFAULT NULL,\n        `delivered_at` datetime DEFAULT NULL,\n        `status` enum('queued','delivered','sending','failed') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'queued',\n        `created_at` datetime NOT NULL,\n        `updated_at` datetime NOT NULL,\n        PRIMARY KEY (`message_id`)\n    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$this->query("\n    CREATE TABLE `push_certificate` (\n        `certificate_id` int(11) NOT NULL AUTO_INCREMENT,\n        `app_id` INT(11) NULL DEFAULT NULL,\n        `type` varchar(30) NOT NULL,\n        `path` varchar(255) NULL DEFAULT NULL,\n        `created_at` datetime NOT NULL,\n        `updated_at` datetime NOT NULL,\n        PRIMARY KEY (`certificate_id`)\n    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$library = new Media_Model_Library();
$library->setName('Push')->save();
$icon_paths = array('/push_notifications/push1.png', '/push_notifications/push2.png', '/push_notifications/push3.png', '/push_notifications/push4.png', '/push_notifications/push5.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' => 'push_notification', 'name' => 'Push Notifications', 'model' => '', 'desktop_uri' => 'push/application/', 'mobile_uri' => 'push/mobile/', 'only_once' => 1, 'is_ajax' => 1, 'position' => 130);
$option = new Application_Model_Option();
$option->setData($datas)->save();
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:20,代码来源:database.1.0.0.php

示例2: DirectoryIterator

<?php

$media_library = new Media_Model_Library();
$media_library->setName("Code Scan")->save();
$icon_id = null;
$files_icon = new DirectoryIterator(Core_Model_Directory::getBasePathTo("images/library/code_scan"));
foreach ($files_icon as $file) {
    if ($file->isDot()) {
        continue;
    }
    $icon = new Media_Model_Library_Image();
    $icon_data = array("library_id" => $media_library->getId(), "link" => "/code_scan/" . $file->getFilename(), "can_be_colorized" => 1);
    $icon->setData($icon_data)->save();
    if ($icon_id == null) {
        $icon_id = $icon->getId();
    }
}
$option_data = array("code" => "code_scan", "name" => "Code Scan", "model" => "Codescan_Model_Codescan", "library_id" => $media_library->getId(), "icon_id" => $icon_id, "desktop_uri" => "codescan/application/", "mobile_uri" => "codescan/mobile_view/", "position" => 150);
$option = new Application_Model_Option();
$option->setData($option_data)->save();
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:20,代码来源:database.3.11.0.install.php


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