本文整理匯總了PHP中Set::Update方法的典型用法代碼示例。如果您正苦於以下問題:PHP Set::Update方法的具體用法?PHP Set::Update怎麽用?PHP Set::Update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Set
的用法示例。
在下文中一共展示了Set::Update方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: preg_match_all
$Set2Process->setDatesPic(Date::ParseDates($datesPic[0], DATE_KIND_IMAGE, $Set2Process));
preg_match_all('/[0-9]{4}-[01][0-9]-[0123][0-9]/ix', (string) $Set->attributes()->date_vid, $datesVid);
$Set2Process->setDatesVid(Date::ParseDates($datesVid[0], DATE_KIND_VIDEO, $Set2Process));
// Reset the Set's CONTAINS_WHAT
$Set2Process->setContainsWhat(SET_CONTENT_NONE);
if ($Set2Process->getDatesPic()) {
$Set2Process->setContainsWhat($Set2Process->getContainsWhat() | SET_CONTENT_IMAGE);
}
if ($Set2Process->getDatesVid()) {
$Set2Process->setContainsWhat($Set2Process->getContainsWhat() | SET_CONTENT_VIDEO);
}
if ($Set2Process->getModel()->getFirstName() == 'Promotions') {
$Set2Process->setContainsWhat($Set2Process->getContainsWhat() | SET_CONTENT_VIDEO);
}
// Update the Set's CONTAINS_WHAT
Set::Update($Set2Process, $CurrentUser);
/* @var $Date Date */
/* @var $dateInDb Date */
foreach ($Set2Process->getDatesPic() as $Date) {
$dateInDb = Date::FilterDates($DatesThisModel, NULL, NULL, $Set2Process->getID(), DATE_KIND_IMAGE, $Date->getTimeStamp());
if ($dateInDb) {
$dateInDb = $dateInDb[0];
$Date->setID($dateInDb->getID());
}
if (!$Date->getID()) {
Date::Insert($Date, $CurrentUser);
}
}
foreach ($Set2Process->getDatesVid() as $Date) {
$dateInDb = Date::FilterDates($DatesThisModel, NULL, NULL, $Set2Process->getID(), DATE_KIND_VIDEO, $Date->getTimeStamp());
if ($dateInDb) {
示例2: CacheImageSearchParameters
$Set->setName(Utils::NullIfEmpty($_POST['txtName']));
$tags = Tag::GetTagArray($_POST['txtTags']);
if (array_key_exists('radContains', $_POST) && $_POST['radContains']) {
$Set->setContainsWhat(intval($_POST['radContains']));
}
if ($Set->getID()) {
if ($DeleteSet) {
if ($CurrentUser->hasPermission(RIGHT_SET_DELETE) && Set::Delete($Set, $CurrentUser)) {
$CacheImages = CacheImage::GetCacheImages(new CacheImageSearchParameters(FALSE, FALSE, $Model->getID()));
CacheImage::DeleteMulti($CacheImages, $CurrentUser);
header('location:' . $ReturnURL);
exit;
}
} else {
if ($CurrentUser->hasPermission(RIGHT_SET_EDIT)) {
$NoErrorDuringPostback = Set::Update($Set, $CurrentUser);
if ($NoErrorDuringPostback) {
Tag2All::HandleTags($tags, $TagsThisSet, $TagsInDB, $CurrentUser, $ModelID, $Set->getID(), NULL, NULL);
}
}
}
} else {
if ($CurrentUser->hasPermission(RIGHT_SET_ADD)) {
if ($NoErrorDuringPostback = Set::Insert($Set, $CurrentUser)) {
$CacheImages = CacheImage::GetCacheImages(new CacheImageSearchParameters(FALSE, FALSE, $Model->getID()));
CacheImage::DeleteMulti($CacheImages, $CurrentUser);
Tag2All::HandleTags($tags, $TagsThisSet, $TagsInDB, $CurrentUser, $ModelID, $Set->getID(), NULL, NULL);
}
}
}
$Set->setDatesPic(HTMLstuff::DatesFromPOST($_POST, $Set, DATE_KIND_IMAGE));