Example #1
0
 public function assign(MessageInterface $message, $body = null)
 {
     if (!($assigned_id = $message->getAssignedId())) {
         return null;
     }
     $attrs = collect($this->attrs($message));
     return $this->dispatchFrom('App\\Jobs\\ActionCreateJob', $attrs->merge(['type' => 'assign', 'assigned_id' => $assigned_id, 'body' => $body]));
 }
Example #2
0
 public function updateAttrs(MessageInterface $message)
 {
     $attrs = ['reason' => $message->getSkinny(), 'ticket_id' => $message->getTicketId()];
     $tags = $message->getTags();
     if ($assigned_id = $message->getAssignedId()) {
         $attrs['assigned_id'] = $assigned_id;
     }
     if ($tags->has('user')) {
         $attrs['user_id'] = $message->getUserId();
     }
     if ($tags->has('priority')) {
         $attrs['priority'] = $tags->get('priority');
     }
     if ($tags->has('org')) {
         $attrs['org_id'] = $message->getOrgId();
     }
     return array_merge($attrs, $this->attrs($message));
 }