+ Error on line 172
$obj->config = $resp->config;
<?php
namespace cbs\core\managers;
use cbs\core\managers\AppManager;
use cbs\core\utils\Input;
use cbs\core\lib\Registry;
use stdClass;
use cbs\core\models\Seo;
/**
* cbs\core\models\Show Homepage Manager
*/
class ShowHomeManager extends AppManager
{
public function __construct($proxyOverride=null)
{
parent::__construct('API', $proxyOverride);
$this->con->overridePlatform(\cbs\core\lib\Platform::PLATFORM_DESKTOP);
}
public function getContent(array $options = [])
{
# set seoPath
$this->setUri();
# options
$picks = isset($options['picks']) ? $options['picks'] : 7;
$promos = isset($options['promos']) ? $options['promos'] : 4;
$query =
'/frontpage/' .
$this->show->id .
'.json?episode_rows=0&callouts_rows=0&picks_rows=' .
$picks .
'&promos_rows=' .
$promos;
if (isset($options['seasonListSort'])) {
$query .=
"&seasonListSort=" . strtolower($options['seasonListSort']);
}
$resp = $this->con->get($query);
$global_nav = isset($resp->globalMenu)
? $this->parseGlobalMenu($resp->globalMenu)
: null;
$footer_menu = isset($resp->globalMenu->footer)
? $this->parseFooterMenu($resp->globalMenu->footer)
: null;
$footer = (isset($resp->globalMenu)) ? $this->parseFooter($resp->globalMenu) : null;
$footer = (isset($resp->globalMenu)) ? $this->parseFooter($resp->globalMenu) : null;
$marquee =
isset($resp->marquees->results) &&
count($resp->marquees->results) > 0
? $resp->marquees->results[0]
: null;
$promos =
isset($resp->promos->results) && count($resp->promos->results) > 0
? $resp->promos->results
: null;
$picks =
isset($resp->picks->results) && count($resp->picks->results) > 0
? $resp->picks->results
: null;
$alert =
isset($resp->alert->results) && count($resp->alert->results) > 0
? $resp->alert->results[0]
: null;
$recaps =
isset($resp->episodes->results) &&
count($resp->episodes->results) > 0
? $resp->episodes->results
: null;
return [
'global_nav' => $global_nav,
'footer_menu' => $footer_menu,
'footer' => $footer,
'marquee' => $marquee,
'promos' => $promos,
'picsoftheweek' => $picks,
'callouts' => '',
'recaps' => $recaps,
'total' => [
'promos' => (isset($resp->promos->numFound)) ? $resp->promos->numFound : null,
'alert' => $alert,
],
'available_video_seasons' => isset($resp->available_video_seasons->itemList) ? $resp->available_video_seasons->itemList
: [],
];
}
public function get(array $options = [], $showId = null)
{
$defaults = [
'episode_rows' => 4,
'promos_rows' => 4,
'album_rows' => 4,
'includeAboutShowPage' => 'true',
];
$options = !empty($options)
? array_merge($defaults, $options)
: $defaults;
# set seoPath
$this->setUri();
# query
$showId = is_null($showId) ? $this->show->id : $showId;
$query = "/frontpage/{$showId}.json";
$query .= "?" . Input::createQuery($options);
$resp = $this->con->switchV3()->get($query);
$this->con->switchV3(false);
$alert =
isset($resp->alerts) && count($resp->alerts) > 0
? $resp->alerts[0]
: null;
$alerts =
isset($resp->alerts) && count($resp->alerts) > 0
? $resp->alerts
: null;
$content = [
'global_nav' => isset($resp->globalMenu)
? $this->parseGlobalMenu($resp->globalMenu)
: null,
'footer_menu' => isset($resp->globalMenu->footer)
? $this->parseFooterMenu($resp->globalMenu->footer)
: null,
'footer' => isset($resp->globalMenu) ? $this->parseFooter($resp->globalMenu) : null,
'footer' => isset($resp->globalMenu) ? $this->parseFooter($resp->globalMenu) : null,
'marquee' => isset($resp->marquees) ? $resp->marquees : null,
'promos' => isset($resp->promos) ? $resp->promos : null,
'promo_facets' => isset($resp->promo_content_type_facets)
? $resp->promo_content_type_facets
: null,
'episodes' => isset($resp->episodes) ? $resp->episodes : null,
'albums' => isset($resp->albums) ? $resp->albums : null,
'related_shows' => isset($resp->relatedShows)
? $resp->relatedShows
: null,
'total' => [
'promos' => isset($resp->facets->promo)
? $resp->facets->promo
: '',
'alert' => $alert,
],
'upsellInfo' => isset($resp->upsellInfo) ? $resp->upsellInfo : null,
'cast' => isset($resp->cast)
? array_map(function ($castItem) {
return new \cbs\core\models\Cast($castItem);
}, $resp->cast)
: null,
'alerts' => $alerts,
];
if (isset($resp->classics)) {
$content['classics'] = $resp->classics;
}
if (isset($resp->showPage)) {
$content['showPage'] = $resp->showPage;
}
$obj = new stdClass();
$obj->show = isset($resp->shows[0]) ? $resp->shows[0] : '';
$obj->config = $resp->config;
$obj->content = $content;
$obj->available_video_seasons = isset($resp->available_video_seasons)
? $resp->available_video_seasons
: [];
$obj->show_premium_counts = isset($resp->show_premium_counts)
? $resp->show_premium_counts
: null;
$obj->alerts = $alerts;
$obj->showMenu = isset($resp->showMenu[0]) ? $resp->showMenu : null;
$obj->tracking = isset($resp->tracking) ? $resp->tracking : null;
$obj->dynamicShowFlags = isset($resp->dynamicShowFlags)
? $resp->dynamicShowFlags
: null;
$default_description = $obj->show->about;
# seo
if (!empty($resp->seo)) {
Registry::set('PAGE_META', new \cbs\core\models\Seo($resp->seo[0]));
}else{
$seoObj = new stdClass();
$seoObj->meta_description = $default_description;
$seoObj->social_description = $default_description;
Registry::set('PAGE_META', new Seo($seoObj));
}
return $obj;
}
}
* Stack Trace...
- /usr/local/deploy/mvc-deploys/mvc-release/htdocs/index.php(168) calling run()
- /usr/local/deploy/mvc-deploys/mvc-release/vendor/viacomcbs/doophp/src/app/DooWebApp.php(34) calling routeTo()
- /usr/local/deploy/mvc-deploys/mvc-release/vendor/viacomcbs/doophp/src/app/DooWebApp.php(122) calling beforeRun()
- /usr/local/deploy/mvc-deploys/mvc-release/vendor/viacomcbs/core/src/controllers/shows/ShowsController.php(111) calling setShow()
- /usr/local/deploy/mvc-deploys/mvc-release/vendor/viacomcbs/core/src/controllers/shows/ShowsHomeController.php(353) calling getLandingPageShow()
- /usr/local/deploy/mvc-deploys/mvc-release/vendor/viacomcbs/core/src/controllers/shows/ShowsHomeController.php(413) calling get()
object(DooConfig)#11 (22) {
["AUTOLOAD"] => NULL
["SITE_PATH"] => string(42) "/usr/local/deploy/mvc-deploys/mvc-release/"
["PROTECTED_FOLDER"] => string(46) "/usr/local/deploy/mvc-deploys/mvc-release/src/"
["BASE_PATH"] => string(70) "/usr/local/deploy/mvc-deploys/mvc-release/vendor/viacomcbs/doophp/src/"
["LOG_PATH"] => NULL
["APP_URL"] => string(24) "http://test-www.cbs.com/"
["SUBFOLDER"] => string(1) "/"
["APP_MODE"] => string(3) "dev"
["AUTOROUTE"] => bool(false)
["DEBUG_ENABLED"] => bool(true)
["ERROR_404_DOCUMENT"] => NULL
["ERROR_404_ROUTE"] => string(48) "/error/?%2Fshows%2Fthe_young_and_the_restless%2F"
["CACHE_PATH"] => NULL
["AUTO_VIEW_RENDER_PATH"] => string(12) "/shows/:slug"
["MEMCACHE"] => NULL
["TEMPLATE_ENGINE"] => string(7) "DooView"
["TEMPLATE_SHOW_COMMENT"] => NULL
["TEMPLATE_ALLOW_PHP"] => NULL
["TEMPLATE_COMPILE_ALWAYS"] => NULL
["TEMPLATE_GLOBAL_TAGS"] => NULL
["MODULES"] => NULL
["APP_NAMESPACE_ID"] => NULL
}
$_COOKIE Variables
array(0) {
}