| @@ -38,9 +38,9 @@ | ||
| 38 | 38 | |
| 39 | 39 | static::deleting(function ($model) { |
| 40 | 40 | //Delete cc info |
| 41 | 41 | Meta::where('object_type', 'response')->where('object_id', $model->id)->delete(); |
| 42 | - // Delete conversation-level attachments — files first, then DB records | |
| 42 | + // Attachment files first, then their rows | |
| 43 | 43 | $class = __NAMESPACE__ . '\Attachment'; |
| 44 | 44 | $attachments = $class::where('conversation_id', $model->id)->get(); |
| 45 | 45 | $class::purgeAttachments($attachments); |
| 46 | 46 | $class::where('conversation_id', $model->id)->delete(); |
| @@ -47,9 +47,8 @@ | ||
| 47 | 47 | }); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | - * $searchable Columns in table to search | |
| 52 | 51 | * @var array |
| 53 | 52 | */ |
| 54 | 53 | protected $searchable = [ |
| 55 | 54 | 'content' |
| @@ -55,9 +54,8 @@ | ||
| 55 | 54 | 'content' |
| 56 | 55 | ]; |
| 57 | 56 | |
| 58 | 57 | /** |
| 59 | - * Local scope to filter subscribers by search/query string | |
| 60 | 58 | * @param ModelQueryBuilder $query |
| 61 | 59 | * @param string $search |
| 62 | 60 | * @return ModelQueryBuilder |
| 63 | 61 | */ |
| @@ -77,11 +75,10 @@ | ||
| 77 | 75 | return $query; |
| 78 | 76 | } |
| 79 | 77 | |
| 80 | 78 | /** |
| 81 | - * Local scope to filter subscribers by search/query string | |
| 82 | 79 | * @param ModelQueryBuilder $query |
| 83 | - * @param string $type | |
| 80 | + * @param array $type | |
| 84 | 81 | * @return ModelQueryBuilder |
| 85 | 82 | */ |
| 86 | 83 | public function scopeFilterByType($query, $type) |
| 87 | 84 | { |
| @@ -90,9 +87,8 @@ | ||
| 90 | 87 | return $query; |
| 91 | 88 | } |
| 92 | 89 | |
| 93 | 90 | /** |
| 94 | - * One2Many: Customer has to many Click Tickets | |
| 95 | 91 | * @return Model Collection |
| 96 | 92 | */ |
| 97 | 93 | public function ticket() |
| 98 | 94 | { |
| @@ -103,9 +99,8 @@ | ||
| 103 | 99 | ); |
| 104 | 100 | } |
| 105 | 101 | |
| 106 | 102 | /** |
| 107 | - * One2Many: Customer has to many Click Tickets | |
| 108 | 103 | * @return Model Collection |
| 109 | 104 | */ |
| 110 | 105 | public function person() |
| 111 | 106 | { |
| @@ -116,9 +111,9 @@ | ||
| 116 | 111 | ); |
| 117 | 112 | } |
| 118 | 113 | |
| 119 | 114 | /** |
| 120 | - * A Conversation belongs to a Customer. | |
| 115 | + * Alias of person(). The author may be an agent, not only a customer. | |
| 121 | 116 | * |
| 122 | 117 | * @return \FluentSupport\App\Models\Model |
| 123 | 118 | */ |
| 124 | 119 | public function customer() |
| @@ -132,9 +127,10 @@ | ||
| 132 | 127 | return $this->hasMany($class, 'conversation_id', 'id'); |
| 133 | 128 | } |
| 134 | 129 | |
| 135 | 130 | /** |
| 136 | - * One2One: Conversation has cc info | |
| 131 | + * CC info stored in fs_meta. | |
| 132 | + * | |
| 137 | 133 | * @return Model Collection |
| 138 | 134 | */ |
| 139 | 135 | public function ccinfo() |
| 140 | 136 | { |