attachments = $attachments; } public function hasAttachments() { return $this->attachments !== null && count($this->attachments) > 0; } }