| Línea 1049... |
Línea 1049... |
| 1049 |
|
1049 |
|
| 1050 |
$commentMapper = CommentMapper::getInstance($this->adapter);
|
1050 |
$commentMapper = CommentMapper::getInstance($this->adapter);
|
| Línea 1051... |
Línea -... |
| 1051 |
$records = $commentMapper->fetchAllPublishedByFeedId($feed->id);
|
- |
|
| 1052 |
|
1051 |
$records = $commentMapper->fetchAllPublishedByFeedId($feed->id);
|
| 1053 |
|
1052 |
|
| 1054 |
|
1053 |
|
| 1055 |
$comments = [];
|
1054 |
$comments = [];
|
| 1056 |
foreach($records as $record)
|
1055 |
foreach($records as $record)
|
| Línea 1076... |
Línea 1075... |
| 1076 |
$comment['link_delete'] = $this->url()->fromRoute('feeds/comments/delete',['id' => $feed->uuid, 'comment' => $record->uuid ]);
|
1075 |
$comment['link_delete'] = $this->url()->fromRoute('feeds/comments/delete',['id' => $feed->uuid, 'comment' => $record->uuid ]);
|
| 1077 |
$comment['link_answer_add'] = $this->url()->fromRoute('feeds/comments/answer',['id' => $feed->uuid, 'comment' => $record->uuid ]);
|
1076 |
$comment['link_answer_add'] = $this->url()->fromRoute('feeds/comments/answer',['id' => $feed->uuid, 'comment' => $record->uuid ]);
|
| 1078 |
$comment['time_elapsed'] = Functions::timeElapsedString($dt->getTimestamp());
|
1077 |
$comment['time_elapsed'] = Functions::timeElapsedString($dt->getTimestamp());
|
| 1079 |
$comment['comment'] = $record->comment;
|
1078 |
$comment['comment'] = $record->comment;
|
| Línea -... |
Línea 1079... |
| - |
|
1079 |
|
| - |
|
1080 |
$records2 = $commentMapper->fetchAllPublishedByCommentId($record->id);
|
| - |
|
1081 |
$answers = [];
|
| - |
|
1082 |
foreach($records2 as $record2)
|
| - |
|
1083 |
{
|
| - |
|
1084 |
$user = $userMapper->fetchOne($record2->user_id);
|
| 1080 |
|
1085 |
$dt = \DateTime::createFromFormat('Y-m-d H:i:s', $record2->added_on);
|
| - |
|
1086 |
|
| - |
|
1087 |
$answer = [];
|
| - |
|
1088 |
$answer['unique'] = uniqid();
|
| - |
|
1089 |
|
| - |
|
1090 |
|
| - |
|
1091 |
$user = $userMapper->fetchOne($record2->user_id);
|
| - |
|
1092 |
if($user->id == $owner->user_id) {
|
| - |
|
1093 |
$answer['user_image'] = $this->url()->fromRoute('storage', ['type' => 'company', 'code' => $company->uuid, 'filename' => $company->image ]);
|
| - |
|
1094 |
$answer['user_url'] = str_replace('[uuid]', $company->uuid, $company_profile_url);
|
| - |
|
1095 |
$answer['user_name'] = $company->name;
|
| - |
|
1096 |
} else {
|
| - |
|
1097 |
$answer['user_image'] = $this->url()->fromRoute('storage', ['type' => 'user', 'code' => $user->uuid, 'filename' => $user->image ]);
|
| - |
|
1098 |
$answer['user_url'] = str_replace('[uuid]', $user->uuid, $user_profile_url);
|
| - |
|
1099 |
$answer['user_name'] = $user->first_name . ' ' . $user->last_name;
|
| - |
|
1100 |
}
|
| - |
|
1101 |
|
| - |
|
1102 |
$answer['link_delete'] = $this->url()->fromRoute('feeds/comments/delete',['id' => $feed->uuid, 'comment' => $record2->uuid ]);
|
| - |
|
1103 |
$answer['time_elapsed'] = Functions::timeElapsedString($dt->getTimestamp());
|
| - |
|
1104 |
$answer['comment'] = $record2->comment;
|
| - |
|
1105 |
|
| - |
|
1106 |
$records2 = $commentMapper->fetchAllPublishedByCommentId($record2->id);
|
| - |
|
1107 |
|
| - |
|
1108 |
|
| - |
|
1109 |
array_push($answers, $answer);
|
| 1081 |
|
1110 |
}
|
| - |
|
1111 |
|
| 1082 |
|
1112 |
$comment['answer'] = $answers;
|
| 1083 |
array_push($comments, $comment);
|
1113 |
array_push($comments, $comment);
|
| 1084 |
}
|
1114 |
}
|
| 1085 |
$item['comment_add_url'] = $this->url()->fromRoute('feeds/comments', ['id' => $feed->uuid]);
|
1115 |
$item['comment_add_url'] = $this->url()->fromRoute('feeds/comments', ['id' => $feed->uuid]);
|