本文整理匯總了PHP中models\SiteModel::getLogoMediaId方法的典型用法代碼示例。如果您正苦於以下問題:PHP SiteModel::getLogoMediaId方法的具體用法?PHP SiteModel::getLogoMediaId怎麽用?PHP SiteModel::getLogoMediaId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models\SiteModel
的用法示例。
在下文中一共展示了SiteModel::getLogoMediaId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createOrEdit
public function createOrEdit(SiteModel $site, UserAccountModel $user)
{
global $DB;
$createdat = \TimeSource::getFormattedForDataBase();
try {
$DB->beginTransaction();
$stat = $DB->prepare("SELECT * FROM site_profile_media_information WHERE site_id=:site_id");
$stat->execute(array('site_id' => $site->getId()));
if ($stat->rowCount() == 1) {
$stat = $DB->prepare("UPDATE site_profile_media_information SET logo_media_id=:logo_media_id " . " WHERE site_id=:site_id");
} else {
$stat = $DB->prepare("INSERT INTO site_profile_media_information (site_id, logo_media_id) " . " VALUES (:site_id, :logo_media_id)");
}
$stat->execute(array('logo_media_id' => $site->getLogoMediaId(), 'site_id' => $site->getId()));
$stat = $DB->prepare("INSERT INTO site_profile_media_history (site_id, logo_media_id, user_account_id, created_at) " . " VALUES (:site_id, :logo_media_id, :user_account_id, :created_at)");
$stat->execute(array('site_id' => $site->getId(), 'logo_media_id' => $site->getLogoMediaId(), 'created_at' => $createdat, 'user_account_id' => $user->getId()));
$data = $stat->fetch();
$DB->commit();
} catch (Exception $e) {
$DB->rollBack();
}
}