本文整理汇总了PHP中Set::Insert方法的典型用法代码示例。如果您正苦于以下问题:PHP Set::Insert方法的具体用法?PHP Set::Insert怎么用?PHP Set::Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Set
的用法示例。
在下文中一共展示了Set::Insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CacheImageSearchParameters
$Set2Process->setPrefix('In_');
$Set2Process->setName((string) $Set->attributes()->name);
} else {
if ($Set2Process->getModel()->getFirstName() == 'Promotions') {
$Set2Process->setPrefix(NULL);
$Set2Process->setName((string) $Set->attributes()->name);
} else {
$Set2Process->setPrefix('set_');
$Set2Process->setName((string) $Set->attributes()->name);
}
}
}
if ($Set2Process->getID()) {
Set::Update($Set2Process, $CurrentUser);
} else {
Set::Insert($Set2Process, $CurrentUser);
$CacheImages = CacheImage::GetCacheImages(new CacheImageSearchParameters(FALSE, FALSE, $Model2Process->getID()));
CacheImage::DeleteMulti($CacheImages, $CurrentUser);
}
$settags = Tag::GetTagArray((string) $Set->attributes()->tags);
$Tag2AllThisSet = Tag2All::Filter($Tag2AllThisModel, NULL, $Model2Process->getID(), $Set2Process->getID(), NULL, NULL);
Tag2All::HandleTags($settags, $Tag2AllThisSet, $TagsInDB, $CurrentUser, $Model2Process->getID(), $Set2Process->getID(), NULL, NULL, FALSE);
$datesPic = array();
$datesVid = array();
preg_match_all('/[0-9]{4}-[01][0-9]-[0123][0-9]/ix', (string) $Set->attributes()->date_pic, $datesPic);
$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()) {
示例2: CacheImageSearchParameters
$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));
$Set->setDatesVid(HTMLstuff::DatesFromPOST($_POST, $Set, DATE_KIND_VIDEO));
/* @var $Date Date */
/* @var $dateInDb Date */
foreach ($Set->getDatesPic() as $Date) {
if ($Date->getID()) {
if ($Date->getTimeStamp() == -1) {
Date::Delete($Date, $CurrentUser);
} else {