Fatal Error :: Call to a member function shop() on a non-object

/var/www/vhosts/cascades-shopping.co.uk/private/app/_code/module_shops/class.frag_shops_general_offers_detail.php [ 36 ]

21    }2223    public function initialize()24    {25        if( $this->dom_exists() )26        {27            $this->DOM->add_css( URL_ROOT.'css/news.css' );28            $this->DOM->add_css( URL_ROOT.'css/slimbox.css' );29            $this->DOM->add_js( URL_ROOT.'scripts/mootools-core-1.3.2-full-compat-yc.js' );30            $this->DOM->add_js( URL_ROOT.'scripts/slimbox.js' );31        }32        $this->managed_object = lib_coredata_context::default_context()33            ->managed_object_for_permalink( lib_coredata_entity::factory( 'offers' ) );34        $this->shop = lib_coredata_context::default_context()->object_for_id( lib_coredata_entity::factory( 'shops' )35            ->set_custom_class( 'mod_shops_managed_object' ) , $this->managed_object->shop() );36    }3738    public function print_content()39    {40        # link41        $link = ( $this->shop != NULL ? $this->shop->uri() : '' );4243        # shop title44        $shop_title = ( $this->shop != NULL ? $this->shop->title() : '');4546        # title47        $title = $this->load_view( 'detail_title', array(48            'title' => ( $this->shop != NULL ? $this->shop->title().' - ' : '' ).$this->managed_object->title()49        ), 'news');50