/** * @param string $repeatType * @param string $configurationString * @return RepeatConfiguration */ public static function Create($repeatType, $configurationString) { $allparts = explode('|', $configurationString); $configParts = array(); if (!empty($allparts[0])) { foreach ($allparts as $part) { $keyValue = explode('=', $part); if (!empty($keyValue[0])) { $configParts[$keyValue[0]] = $keyValue[1]; } } } $config = new RepeatConfiguration(); $config->Type = empty($repeatType) ? RepeatType::None : $repeatType; $config->Interval = self::Get($configParts, 'interval'); $config->SetTerminationDate(self::Get($configParts, 'termination')); $config->SetWeekdays(self::Get($configParts, 'days')); $config->MonthlyType = self::Get($configParts, 'type'); return $config; }