Rubenwouters\CrmLauncher\Updates\UpdateAllCases::collectPrivateConversations PHP Method

collectPrivateConversations() public method

Handles all private conversations from Facebook
public collectPrivateConversations ( ) : void
return void
    public function collectPrivateConversations()
    {
        $newest = $this->message->getNewestMessageDate();
        $conversations = $this->facebookContent->fetchPrivateConversations();
        foreach ($conversations->data as $key => $conversation) {
            if (changeFbDateFormat($conversation->updated_time) > $newest) {
                $this->collectPrivateMessages($conversation, $newest);
            }
        }
    }

Usage Example

 /**
  * 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');
 }