| Línea 1058... |
Línea 1058... |
| 1058 |
|
1058 |
|
| 1059 |
$request = $this->getRequest();
|
1059 |
$request = $this->getRequest();
|
| Línea 1060... |
Línea 1060... |
| 1060 |
if ($request->isGet()) {
|
1060 |
if ($request->isGet()) {
|
| 1061 |
|
1061 |
|
| 1062 |
$page = (int) $this->params()->fromQuery('page');
|
1062 |
$page = (int) $this->params()->fromQuery('page');
|
| 1063 |
if ($type == 'user') {
|
1063 |
if ($type == 'user' || $type == 'company' || $type == 'group') {
|
| 1064 |
$connectionMapper = ConnectionMapper::getInstance($this->adapter);
|
1064 |
$connectionMapper = ConnectionMapper::getInstance($this->adapter);
|
| 1065 |
$records = $connectionMapper->fetchAllConnectionsByUser($id);
|
1065 |
$records = $connectionMapper->fetchAllConnectionsByUser($id);
|
| 1066 |
$connectionIds = [0];
|
1066 |
$connectionIds = [0];
|
| Línea 1105... |
Línea 1105... |
| 1105 |
->OR->NEST->and->equalTo('type', Feed::TYPE_UPDATE)->and->equalTo('shared_with', Feed::SHARE_WITH_PUBLIC)->UNNEST
|
1105 |
->OR->NEST->and->equalTo('type', Feed::TYPE_UPDATE)->and->equalTo('shared_with', Feed::SHARE_WITH_PUBLIC)->UNNEST
|
| 1106 |
->OR->NEST->in('user_id', $connectionIds)->and->equalTo('type', Feed::TYPE_UPDATE)->and->equalTo('shared_with', Feed::SHARE_WITH_CONNECTIONS)->UNNEST
|
1106 |
->OR->NEST->in('user_id', $connectionIds)->and->equalTo('type', Feed::TYPE_UPDATE)->and->equalTo('shared_with', Feed::SHARE_WITH_CONNECTIONS)->UNNEST
|
| 1107 |
->OR->NEST->or->in('company_id', $companyIds)->and->equalTo('type', Feed::TYPE_COMPANY)->UNNEST
|
1107 |
->OR->NEST->or->in('company_id', $companyIds)->and->equalTo('type', Feed::TYPE_COMPANY)->UNNEST
|
| 1108 |
->UNNEST;
|
1108 |
->UNNEST;
|
| 1109 |
$select->order('added_on desc');
|
1109 |
$select->order('added_on desc');
|
| - |
|
1110 |
}
|
| 1110 |
} elseif ($type == 'company') {
|
1111 |
//if ($type == 'company') {
|
| 1111 |
$companyMapper = CompanyMapper::getInstance($this->adapter);
|
1112 |
$companyMapper = CompanyMapper::getInstance($this->adapter);
|
| 1112 |
$company = $companyMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
|
1113 |
$company = $companyMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
|
| Línea 1113... |
Línea 1114... |
| 1113 |
|
1114 |
|
| 1114 |
if (!$company || $company->status != Company::STATUS_ACTIVE) {
|
1115 |
if (!$company || $company->status != Company::STATUS_ACTIVE) {
|
| Línea 1138... |
Línea 1139... |
| 1138 |
$select->where->equalTo('network_id', $currentUser->network_id);
|
1139 |
$select->where->equalTo('network_id', $currentUser->network_id);
|
| 1139 |
$select->where->equalTo('status', Feed::STATUS_PUBLISHED);
|
1140 |
$select->where->equalTo('status', Feed::STATUS_PUBLISHED);
|
| 1140 |
$select->where->equalTo('company_id', $id);
|
1141 |
$select->where->equalTo('company_id', $id);
|
| 1141 |
$select->where->and->equalTo('type', Feed::TYPE_COMPANY);
|
1142 |
$select->where->and->equalTo('type', Feed::TYPE_COMPANY);
|
| 1142 |
$select->order('added_on desc');
|
1143 |
$select->order('added_on desc');
|
| - |
|
1144 |
// }
|
| 1143 |
} elseif ($type == 'group') {
|
1145 |
//if ($type == 'group') {
|
| 1144 |
$groupMapper = GroupMapper::getInstance($this->adapter);
|
1146 |
$groupMapper = GroupMapper::getInstance($this->adapter);
|
| 1145 |
$group = $groupMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
|
1147 |
$group = $groupMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
|
| Línea 1146... |
Línea 1148... |
| 1146 |
|
1148 |
|