public function loadAction($nid) { var_dump(\Rpp\Services\Get\Article::part($nid, 'categorias')); var_dump(\Rpp\Services\Get\Article::part($nid, 'titulo')); var_dump(\Rpp\Services\Get\Article::part($nid, 'titulo_seo')); var_dump(\Rpp\Services\Get\Article::part($nid, 'contenido')); var_dump(\Rpp\Services\Get\Article::part($nid, 'permalink')); var_dump(\Rpp\Services\Get\Article::part($nid, 'autor')); var_dump(\Rpp\Services\Get\Article::part($nid, 'media_tipos')); var_dump(\Rpp\Services\Get\Article::part($nid, 'categorias')); var_dump(\Rpp\Services\Get\Article::part($nid, 'tags')); var_dump(\Rpp\Services\Get\Article::part($nid, 'keywords')); var_dump(\Rpp\Services\Get\Article::part($nid, 'imagen_portada')); var_dump(\Rpp\Services\Get\Article::part($nid, 'portada_thumb')); var_dump(\Rpp\Services\Get\Article::part($nid, 'categoria')); var_dump(\Rpp\Services\Get\Article::part($nid, 'bajada')); }
private function load_sugeridas() { $user = $this->user; $sugeridas = array(); $tags_list = array(); $nids_top = array(); if (!empty($user)) { Sugeridos::load($user); if (Cache::request()->exists('sugeridas:by:' . $this->nid . ':' . $user)) { return $sugeridas = Cache::request()->get('sugeridas:by:' . $this->nid . ':' . $user); } if (is_array(\Rpp\Services\Get\Article::part($this->nid, 'tags'))) { foreach (\Rpp\Services\Get\Article::part($this->nid, 'tags') as $tag) { $tags_list[$tag['slug']] = Sugeridos::get_tag($tag['slug']); foreach ($tags_list[$tag['slug']] as $nid) { if (isset($nids_top[$nid])) { $nids_top[$nid]++; } else { $nids_top[$nid] = 1; } } } } arsort($nids_top); unset($nids_top[$this->nid]); $nids_top = array_slice($nids_top, 0, 3, true); $nids_top = array_keys($nids_top); $nids_top = array_combine($nids_top, $nids_top); if (count($nids_top) >= 3) { $sugeridas = $nids_top; } else { $slug = explode('/', \Rpp\Services\Get\Article::part($this->nid, 'categoria')['slug']); $nids_by_seccion = Sugeridos::get_seccion($slug[1]); unset($nids_by_seccion[$this->nid]); $sugeridas = $nids_by_seccion + $nids_top; $sugeridas = array_slice($sugeridas, 0, 4, true); } Cache::request()->save('sugeridas:by:' . $this->nid . ':' . $user, $sugeridas, 72000); } return $sugeridas; }