public function getTemplate(Business $business, Service $service)
 {
     $this->addServiceStatement($service);
     $this->addDaysStatement();
     $this->addTimeRangeStatement($business->pref('start_at'), $business->pref('finish_at'));
     return $this->build();
 }
 protected function setBusinessPreferences(Business $business, $preferences)
 {
     // Get parameters from app configuration
     $parameters = config()->get('preferences.Timegridio\\Concierge\\Models\\Business');
     // Get the keys of the parameters
     $parametersKeys = array_flip(array_keys($parameters));
     // Merge the user input with the parameter keys
     $mergedPreferences = array_intersect_key($preferences, $parametersKeys);
     // Store each parameter key-value pair to the business preferences
     foreach ($mergedPreferences as $key => $value) {
         logger()->info(sprintf("set preference: businessId:%s key:%s='%s' type:%s", $business->id, $key, $value, $parameters[$key]['type']));
         $business->pref($key, $value, $parameters[$key]['type']);
     }
 }
示例#3
0
 protected function calculateStep(Business $business, $defaultStep = 30)
 {
     $step = $business->pref('timeslot_step');
     if (0 != $step) {
         return $step;
     }
     return $defaultStep;
 }
 protected function autopublishVacancies(Business $business)
 {
     return $business->pref('vacancy_autopublish');
 }
示例#5
0
 protected function enabledReports(Business $business)
 {
     return $business->pref('report_daily_schedule');
 }