本文整理汇总了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()})");
}
}
示例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());
}
示例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());
}
示例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;
}
示例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;
}
示例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];
}
示例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);
}