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


PHP Package::getId方法代码示例

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


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

示例1: noticePackageUploaded

 public function noticePackageUploaded(Package $pkg)
 {
     $app = $this->app;
     $package_url = mfwRequest::makeURL("/package?id={$pkg->getId()}");
     ob_start();
     include APP_ROOT . '/data/notice_mail_template.php';
     $body = ob_get_clean();
     $addresses = array();
     foreach ($this->rows as $r) {
         if ($r['notify']) {
             $addresses[] = $r['mail'];
         }
     }
     if (empty($addresses)) {
         return;
     }
     $subject = "New Package Uploaded to {$app->getTitle()}";
     $sender = Config::get('mail_sender');
     $to = $sender;
     $header = "From: {$sender}" . "\nBcc: " . implode(', ', $addresses);
     mb_language('uni');
     mb_internal_encoding('UTF-8');
     if (!mb_send_mail($to, $subject, $body, $header)) {
         throw new RuntimeException("mb_send_mail faild (pkg={$pkg->getId()}, {$pkg->getTitle()})");
     }
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:26,代码来源:InstallUser.php

示例2: makePackageArray

 protected function makePackageArray(Package $pkg)
 {
     $tags = array();
     foreach ($pkg->getTags() as $t) {
         $tags[] = $t->getName();
     }
     return array('package_url' => mfwRequest::makeUrl("/package?id={$pkg->getId()}"), 'application_url' => mfwRequest::makeUrl("/app?id={$pkg->getAppId()}"), 'id' => $pkg->getId(), 'platform' => $pkg->getPlatform(), 'title' => $pkg->getTitle(), 'description' => $pkg->getDescription(), 'ios_identifier' => $pkg->getIOSIdentifier(), 'original_file_name' => $pkg->getOriginalFileName(), 'file_size' => $pkg->getFileSize(), 'created' => $pkg->getCreated(), 'tags' => $tags, 'install_count' => $pkg->getInstallCount());
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:8,代码来源:actions.php

示例3: testGetAndSetId

 public function testGetAndSetId()
 {
     $this->assertEquals(null, $this->sut->getId());
     // XXX Doctrine uses reflection, so there's no other way
     // to unit test this
     $reflProp = new \ReflectionProperty('Terramar\\Packages\\Entity\\Remote', 'id');
     $reflProp->setAccessible(true);
     $reflProp->setValue($this->sut, 345);
     $reflProp->setAccessible(false);
     $this->assertEquals(345, $this->sut->getId());
 }
开发者ID:Barbarrosa,项目名称:packages,代码行数:11,代码来源:RemoteTest.php

示例4: getPackageInstalledDate

 public function getPackageInstalledDate(Package $pkg, $format = null)
 {
     $appid = $pkg->getAppId();
     if (!isset($this->pkg_install_dates[$appid])) {
         $this->pkg_install_dates[$appid] = InstallLog::packageInstalledDates($this, $appid);
     }
     if (!isset($this->pkg_install_dates[$appid][$pkg->getId()])) {
         return null;
     }
     $date = $this->pkg_install_dates[$appid][$pkg->getId()];
     if ($format) {
         $date = date($format, strtotime($date));
     }
     return $date;
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:15,代码来源:User.php

示例5: getPackageInstallUsers

 public static function getPackageInstallUsers(Package $pkg)
 {
     $sql = 'SELECT distinct(mail) FROM install_log WHERE package_id = ?';
     $rows = mfwDBIBase::getAll($sql, array($pkg->getId()));
     $mails = array();
     foreach ($rows as $r) {
         $mails[] = $r['mail'];
     }
     return $mails;
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:10,代码来源:InstallLog.php

示例6: getPackageId

 /**
  * Get the package ID from database or create it in database
  * @param string $package
  * @return int
  */
 private function getPackageId($package)
 {
     if ($package === null || trim($package) == '') {
         return null;
     }
     if (!isset($this->packageIds[$package])) {
         $this->packageIds[$package] = Package::getId($package);
     }
     return $this->packageIds[$package];
 }
开发者ID:nkammah,项目名称:Crash-Analytics,代码行数:15,代码来源:Calculation.php

示例7: removeFromPackage

 public static function removeFromPackage(Package $pkg, $con = null)
 {
     $sql = 'DELETE FROM package_tag WHERE package_id = ?';
     mfwDBIBase::query($sql, array($pkg->getId()), $con);
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:5,代码来源:Tag.php


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