Addded cifurl and -cable url to Preordercampaign

This commit is contained in:
Frank Schubert
2024-02-23 16:37:12 +01:00
parent ec1d6f803c
commit 8fbea5f824
7 changed files with 122 additions and 7 deletions
+19 -1
View File
@@ -358,7 +358,7 @@ class Preorder extends mfBaseModel {
public function createCiftoken() {
$ciftoken = $this->generateNewCiftoken();
while(PreorderModel::search(['ciftoken' => $ciftoken])) {
while(PreorderModel::getFirst(['ciftoken' => $ciftoken])) {
$ciftoken = $this->generateNewCiftoken();
}
$this->ciftoken = $ciftoken;
@@ -375,6 +375,24 @@ class Preorder extends mfBaseModel {
return $ciftoken;
}
public function generateCifUrl() {
$campaign = $this->getProperty("campaign");
$cifurl = $campaign->cifurl;
str_replace("{{CIFTOKEN}}", $this->ciftoken, $cifurl);
return $cifurl;
}
public function generateCifCableUrl() {
$campaign = $this->getProperty("campaign");
$cifcableurl = $campaign->cifcableurl;
str_replace("{{}}", $this->ciftoken, $cifcableurl);
return $cifcableurl;
}
public function getCifdataApiArray() {
if(!$this->id) {
return false;