當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。