Rubenwouters\CrmLauncher\Models\Log::updateLog PHP Method

updateLog() public method

Updates logs to keep track of API rate limits
public updateLog ( string $type ) : void
$type string
return void
    public function updateLog($type)
    {
        $log = new Log();
        if ($type == 'fetching') {
            $log->case_type = "fetching";
        } else {
            if ($type == 'dashboard_update') {
                $log->case_type = "dashboard_update";
            } else {
                if ($type == 'stats') {
                    $log->case_type = 'stats';
                } else {
                    if ($type == 'publishments') {
                        $log->case_type = 'publishments';
                    } else {
                        if ($type == 'publishment_detail') {
                            $log->case_type = 'publishment_detail';
                        }
                    }
                }
            }
        }
        $log->save();
    }

Usage Example

示例#1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     if (isFacebookLinked()) {
         $this->update->collectPrivateConversations();
         $this->update->collectPosts();
     }
     if (isTwitterLinked()) {
         $this->update->collectMentions();
         $this->update->collectDirectMessages();
     }
     $this->log->updateLog('fetching');
 }
All Usage Examples Of Rubenwouters\CrmLauncher\Models\Log::updateLog