| @@ -11,8 +11,23 @@ | ||
| 11 | 11 | * |
| 12 | 12 | * @package FluentCommunity\App\Models |
| 13 | 13 | * |
| 14 | 14 | * @version 1.0.0 |
| 15 | + * | |
| 16 | + * @property int $id | |
| 17 | + * @property int|null $user_id | |
| 18 | + * @property int|null $feed_id | |
| 19 | + * @property int|null $space_id | |
| 20 | + * @property int|null $related_id | |
| 21 | + * @property string|null $message | |
| 22 | + * @property int|null $is_public | |
| 23 | + * @property string|null $action_name | |
| 24 | + * @property string|null $created_at | |
| 25 | + * @property string|null $updated_at | |
| 26 | + * @property-read Feed|null $feed | |
| 27 | + * @property-read BaseSpace|null $space | |
| 28 | + * @property-read User|null $user | |
| 29 | + * @property-read XProfile|null $xprofile | |
| 15 | 30 | */ |
| 16 | 31 | class Activity extends Model |
| 17 | 32 | { |
| 18 | 33 | protected $table = 'fcom_user_activities'; |
| @@ -18,9 +33,9 @@ | ||
| 18 | 33 | protected $table = 'fcom_user_activities'; |
| 19 | 34 | |
| 20 | 35 | protected $primaryKey = 'id'; |
| 21 | 36 | |
| 22 | - protected $guarded = ['id']; | |
| 37 | + protected $guarded = [ 'id' ]; | |
| 23 | 38 | |
| 24 | 39 | protected $fillable = [ |
| 25 | 40 | 'user_id', |
| 26 | 41 | 'feed_id', |
| @@ -27,9 +42,9 @@ | ||
| 27 | 42 | 'space_id', |
| 28 | 43 | 'related_id', |
| 29 | 44 | 'message', |
| 30 | 45 | 'is_public', |
| 31 | - 'action_name' | |
| 46 | + 'action_name', | |
| 32 | 47 | ]; |
| 33 | 48 | |
| 34 | 49 | public static function boot() |
| 35 | 50 | { |
| @@ -84,13 +99,13 @@ | ||
| 84 | 99 | |
| 85 | 100 | switch ($this->action_name) { |
| 86 | 101 | case 'feed_published': |
| 87 | 102 | /* translators: %1$s is the person name and %2$s is the feed excerpt */ |
| 88 | - $message = sprintf(__('%1$s published a new status %2$s', 'fluent-community'), '<span class="fcom_user_name">' . esc_html($this->xprofile->display_name) . '</span>', '<span class="fcom_feed_excerpt">' . $this->feed->getHumanExcerpt() . '</span>'); | |
| 103 | + $message = sprintf(__('%1$s published a new status %2$s', 'fluent-community'), '<span class="fcom_user_name">' . esc_html($this->xprofile->display_name) . '</span>', '<span class="fcom_feed_excerpt">' . esc_html($this->feed->getHumanExcerpt()) . '</span>'); | |
| 89 | 104 | break; |
| 90 | 105 | case 'comment_added': |
| 91 | 106 | /* translators: %1$s is the person name and %2$s is the feed excerpt */ |
| 92 | - $message = sprintf(__('%1$s added a comment on %2$s', 'fluent-community'), '<span class="fcom_user_name">' . esc_html($this->xprofile->display_name) . '</span>', '<span class="fcom_feed_excerpt">' . $this->feed->getHumanExcerpt() . '</span>'); | |
| 107 | + $message = sprintf(__('%1$s added a comment on %2$s', 'fluent-community'), '<span class="fcom_user_name">' . esc_html($this->xprofile->display_name) . '</span>', '<span class="fcom_feed_excerpt">' . esc_html($this->feed->getHumanExcerpt()) . '</span>'); | |
| 93 | 108 | break; |
| 94 | 109 | } |
| 95 | 110 | |
| 96 | 111 | return $message; |