public function addSet($name) { $s = new Set(); $s->setName($name); $this->sets[] = $s; return $s; }
$DatesThisSet = Date::GetDates(new DateSearchParameters(FALSE, FALSE, $Set->getID())); } else { $Set = new Set(NULL, $lang->g('New')); $Model = Model::GetModels(new ModelSearchParameters($ModelID)); if ($Model) { $Model = $Model[0]; } else { header('location:index.php'); exit; } $Set->setModel($Model); } $DatesThisSet[] = new Date(NULL, DATE_KIND_UNKNOWN, -1, $Set->getID(), $Set->getPrefix(), $Set->getName(), $Set->getContainsWhat(), $Model->getID(), $Model->getFirstName(), $Model->getLastName()); if (array_key_exists('hidAction', $_POST) && $_POST['hidAction'] == 'SetView') { $Set->setPrefix(Utils::NullIfEmpty($_POST['txtPrefix'])); $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);