Phalcon Framework 3.3.1

Error: Call to a member function getKey() on null

/var/www/vhosts/dasapartmentliving.de/app/Controllers/Web/BaseController.php (547)
#0App\Controllers\Web\BaseController->setBreadcrumbs(kategorie)
/var/www/vhosts/dasapartmentliving.de/app/Controllers/Web/KategorieController.php (43)
<?php
namespace App\Controllers\Web;
 
use Phery;
use App\Models\Artikel;
use App\Models\Kategorie;
use App\Helpers\ArtikelFilter;
use App\Controllers\Web\BaseController;
 
 
class KategorieController extends BaseController {
 
 
  private $ArtikelPage;
  private $sidebarNavi;
  private $filterAry;
 
 
    public function indexAction() {
    if (Phery::is_ajax(true)) {
      $this->setPhery($this);
    }
    else {
      parent::setBaseValues();
      parent::setTreeNavis();
 
      if($this->setProperties()) {
        $this->setView();
      }
      else {
        $this->get404Page();
      }
    }
    }
 
 
  private function setProperties() {
    $this->setKategorie();
    $this->setArtikelPage();
    $this->setFilterAry();
 
    if($this->Kategorie) {
      $this->setBreadcrumbs("kategorie");
      return true;
    }
    return false;
  }
 
 
  private function setKategorie(){
    if(($this->Kategorie = Kategorie::findFirstByNodePerma($this->perma))) {
      $this->sidebarNavi = $this->getKategorieSidebarNavi($this->Kategorie);
    }
  }
 
 
  private function setArtikelPage(){
    $args = [
      "is_online" => "ja",
      "site" => $this->site, 
      "filter" => $this->filter,
      "kategorie_id" => ($this->Kategorie ? $this->Kategorie->getKey() : null),
    ];
 
    $this->ArtikelPage = Artikel::fetchArtikels($args);
  }
 
 
  private function setFilterAry(){
    $kategorie_id = ($this->Kategorie ? $this->Kategorie->getKey() : null);
 
    $args = [
      "filter" => $this->filter,
      "kategorie_id" => $kategorie_id
    ];
 
    $ArtikelFilter = new ArtikelFilter();
    $this->filterAry = $ArtikelFilter->getFilterAry($args);
  }
 
 
  private function setView(){
    $this->view->setVar("Kategorie", $this->Kategorie);
    $this->view->setVar("ArtikelPage", $this->ArtikelPage);
    $this->view->setVar("sidebarNavi", $this->sidebarNavi);
    $this->view->setVar("filterAry", $this->filterAry);
    $this->view->setVar("page_title", ($this->Kategorie ? $this->Kategorie->node_name : "Kategorie"));
 
    /*
     * metas
     */
    $this->view->setVar('meta_title', $this->Kategorie->node_name.' Shop | das apartment Living');
    $this->view->setVar('meta_descr', $this->Kategorie->node_name.' kaufen im Shop bei das apartment Living.');
    $this->view->setVar('meta_keys', $this->Kategorie->node_name.', Shop, das apartment Living');
  }
 
 
  public function getArtikelPage($args){
    $this->setBaseValues($args);
    $this->setKategorie();
    $this->setArtikelPage();
    $this->setFilterAry();
 
    $url_filter = parent::getFilterAryFromParams(array_get($args, "filter"));
    return parent::getPheryArtikelPage($this->ArtikelPage, $this->filterAry, $url_filter);
  }
 
 
  protected function setPheryRemote($remote = null) {
    if ("getArtikelPage" === $remote) {
      $this->Phry->set([$remote => [$this, 'getArtikelPage']]);
    }
  }
 
 
}
#1App\Controllers\Web\KategorieController->setProperties()
/var/www/vhosts/dasapartmentliving.de/app/Controllers/Web/KategorieController.php (27)
<?php
namespace App\Controllers\Web;
 
use Phery;
use App\Models\Artikel;
use App\Models\Kategorie;
use App\Helpers\ArtikelFilter;
use App\Controllers\Web\BaseController;
 
 
class KategorieController extends BaseController {
 
 
  private $ArtikelPage;
  private $sidebarNavi;
  private $filterAry;
 
 
    public function indexAction() {
    if (Phery::is_ajax(true)) {
      $this->setPhery($this);
    }
    else {
      parent::setBaseValues();
      parent::setTreeNavis();
 
      if($this->setProperties()) {
        $this->setView();
      }
      else {
        $this->get404Page();
      }
    }
    }
 
 
  private function setProperties() {
    $this->setKategorie();
    $this->setArtikelPage();
    $this->setFilterAry();
 
    if($this->Kategorie) {
      $this->setBreadcrumbs("kategorie");
      return true;
    }
    return false;
  }
 
 
  private function setKategorie(){
    if(($this->Kategorie = Kategorie::findFirstByNodePerma($this->perma))) {
      $this->sidebarNavi = $this->getKategorieSidebarNavi($this->Kategorie);
    }
  }
 
 
  private function setArtikelPage(){
    $args = [
      "is_online" => "ja",
      "site" => $this->site, 
      "filter" => $this->filter,
      "kategorie_id" => ($this->Kategorie ? $this->Kategorie->getKey() : null),
    ];
 
    $this->ArtikelPage = Artikel::fetchArtikels($args);
  }
 
 
  private function setFilterAry(){
    $kategorie_id = ($this->Kategorie ? $this->Kategorie->getKey() : null);
 
    $args = [
      "filter" => $this->filter,
      "kategorie_id" => $kategorie_id
    ];
 
    $ArtikelFilter = new ArtikelFilter();
    $this->filterAry = $ArtikelFilter->getFilterAry($args);
  }
 
 
  private function setView(){
    $this->view->setVar("Kategorie", $this->Kategorie);
    $this->view->setVar("ArtikelPage", $this->ArtikelPage);
    $this->view->setVar("sidebarNavi", $this->sidebarNavi);
    $this->view->setVar("filterAry", $this->filterAry);
    $this->view->setVar("page_title", ($this->Kategorie ? $this->Kategorie->node_name : "Kategorie"));
 
    /*
     * metas
     */
    $this->view->setVar('meta_title', $this->Kategorie->node_name.' Shop | das apartment Living');
    $this->view->setVar('meta_descr', $this->Kategorie->node_name.' kaufen im Shop bei das apartment Living.');
    $this->view->setVar('meta_keys', $this->Kategorie->node_name.', Shop, das apartment Living');
  }
 
 
  public function getArtikelPage($args){
    $this->setBaseValues($args);
    $this->setKategorie();
    $this->setArtikelPage();
    $this->setFilterAry();
 
    $url_filter = parent::getFilterAryFromParams(array_get($args, "filter"));
    return parent::getPheryArtikelPage($this->ArtikelPage, $this->filterAry, $url_filter);
  }
 
 
  protected function setPheryRemote($remote = null) {
    if ("getArtikelPage" === $remote) {
      $this->Phry->set([$remote => [$this, 'getArtikelPage']]);
    }
  }
 
 
}
#2App\Controllers\Web\KategorieController->indexAction(/moebel/wohnzimmer/truhen)
#3Phalcon\Dispatcher->callActionMethod(Object(App\Controllers\Web\KategorieController), indexAction, Array([param] => /moebel/wohnzimmer/truhen))
#4Phalcon\Dispatcher->dispatch()
#5Phalcon\Mvc\Application->handle()
/var/www/vhosts/dasapartmentliving.de/httpdocs/index.php (81)
<?php
 
date_default_timezone_set("Europe/Amsterdam");
 
use Phalcon\Mvc\Application;
use App\Helpers\ErrorHandler;
use Phalcon\Config\Adapter\Ini as ConfigIni;
 
 
try {
 
 
  define("PAGE_CALL", "frontend");
  $addr_ary = ['80.147.5.240', '80.147.5.249'];
  define("IS_KCS", in_array($_SERVER['REMOTE_ADDR'], $addr_ary));
 
 
  /*
   * Read the configuration 
   */
  $host_ary = ['dasapartmentliving.kcs.hamburg'];
  if(in_array($_SERVER['HTTP_HOST'], $host_ary)) {
    $Config = new ConfigIni('../app/config/testing.ini');
  }
  else {
    $Config = new ConfigIni('../app/config/production.ini');
  }
 
  
 
  foreach($Config->constants AS $def => $val){
    define($def, $val);
  }
 
  foreach($Config->constantsWeb AS $def => $val){
    define($def, $val);
  }
 
 
  /*
   * set config_path
   */
  $config_path = APP_PATH.'app/config/web/';
 
 
   /**
     * Auto-loader configuration
     */
  require APP_PATH.'vendor/autoload.php';
  require $config_path.'loader.php';
 
 
  /*
   * set ErrorHandler
   */
  $ErrorHandler = new ErrorHandler();
  set_error_handler([$ErrorHandler, "errorHandler"]);
 
 
  /*
   * load application services
   */
  require $config_path.'services.php';
 
 
    /*
   * Handle the request
   */
    $App = new Application($di);
 
 
  /*
   * Handle debugbar
   */
  if(true===$Config->web->useDebugbar) {
    $di['app'] = $App;
    (new Snowair\Debugbar\ServiceProvider($config_path.'debugbar.php'))->start();  
  }
 
 
    echo $App->handle()->getContent();
 
}
catch (\Exception $e) {
  echo get_class($e), ": ", $e->getMessage(), "\n";
    echo " File=", $e->getFile(), "\n";
    echo " Line=", $e->getLine(), "\n";
  echo $e->getTraceAsString();
}
KeyValue
_url/c/moebel/wohnzimmer/truhen/
KeyValue
USERapartment_live
HOME/var/www/vhosts/dasapartmentliving.de
SCRIPT_NAME/index.php
REQUEST_URI/c/moebel/wohnzimmer/truhen/
QUERY_STRING_url=/c/moebel/wohnzimmer/truhen/
REQUEST_METHODGET
SERVER_PROTOCOLHTTP/1.0
GATEWAY_INTERFACECGI/1.1
REDIRECT_URL/c/moebel/wohnzimmer/truhen/
REDIRECT_QUERY_STRING_url=/c/moebel/wohnzimmer/truhen/
REMOTE_PORT42530
SCRIPT_FILENAME/var/www/vhosts/dasapartmentliving.de/httpdocs/index.php
SERVER_ADMINsupport@kcs.info
CONTEXT_DOCUMENT_ROOT/var/www/vhosts/dasapartmentliving.de/httpdocs
CONTEXT_PREFIX
REQUEST_SCHEMEhttps
DOCUMENT_ROOT/var/www/vhosts/dasapartmentliving.de/httpdocs
REMOTE_ADDR54.81.183.183
SERVER_PORT443
SERVER_ADDR46.229.46.189
SERVER_NAMEwww.dasapartmentliving.de
SERVER_SOFTWAREApache
SERVER_SIGNATURE
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENTCCBot/2.0 (http://commoncrawl.org/faq/)
HTTP_ACCEPT_ENCODINGx-gzip, gzip, deflate
HTTP_CONNECTIONclose
HTTP_X_ACCEL_INTERNAL/internal-nginx-static-location
HTTP_X_REAL_IP54.81.183.183
HTTP_HOSTwww.dasapartmentliving.de
proxy-nokeepalive1
HTTPSon
SCRIPT_URIhttps://www.dasapartmentliving.de/c/moebel/wohnzimmer/truhen/
SCRIPT_URL/c/moebel/wohnzimmer/truhen/
UNIQUE_IDWwPlFt6FbJtVLGHCm4DshgAAAM4
REDIRECT_STATUS200
REDIRECT_HTTPSon
REDIRECT_SCRIPT_URIhttps://www.dasapartmentliving.de/c/moebel/wohnzimmer/truhen/
REDIRECT_SCRIPT_URL/c/moebel/wohnzimmer/truhen/
REDIRECT_UNIQUE_IDWwPlFt6FbJtVLGHCm4DshgAAAM4
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1526981910.1099
REQUEST_TIME1526981910
#Path
0/var/www/vhosts/dasapartmentliving.de/httpdocs/index.php
1/var/www/vhosts/dasapartmentliving.de/vendor/autoload.php
2/var/www/vhosts/dasapartmentliving.de/vendor/composer/autoload_real.php
3/var/www/vhosts/dasapartmentliving.de/vendor/composer/ClassLoader.php
4/var/www/vhosts/dasapartmentliving.de/vendor/composer/autoload_static.php
5/var/www/vhosts/dasapartmentliving.de/vendor/symfony/polyfill-mbstring/bootstrap.php
6/var/www/vhosts/dasapartmentliving.de/vendor/symfony/var-dumper/Resources/functions/dump.php
7/var/www/vhosts/dasapartmentliving.de/vendor/swiftmailer/swiftmailer/lib/swift_required.php
8/var/www/vhosts/dasapartmentliving.de/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php
9/var/www/vhosts/dasapartmentliving.de/vendor/snowair/phalcon-debugbar/src/Debug.php
10/var/www/vhosts/dasapartmentliving.de/app/Helpers/functions.php
11/var/www/vhosts/dasapartmentliving.de/app/Helpers/array.php
12/var/www/vhosts/dasapartmentliving.de/app/config/web/loader.php
13/var/www/vhosts/dasapartmentliving.de/app/Helpers/ErrorHandler.php
14/var/www/vhosts/dasapartmentliving.de/app/config/web/services.php
15/var/www/vhosts/dasapartmentliving.de/app/Controllers/Web/KategorieController.php
16/var/www/vhosts/dasapartmentliving.de/app/Controllers/Web/BaseController.php
17/var/www/vhosts/dasapartmentliving.de/vendor/phery/phery/Phery.php
18/var/www/vhosts/dasapartmentliving.de/app/Helpers/SessionBag.php
19/var/www/vhosts/dasapartmentliving.de/app/Models/Translation.php
20/var/www/vhosts/dasapartmentliving.de/app/Models/BaseModel.php
21/var/www/vhosts/dasapartmentliving.de/vendor/phalcon/incubator/Library/Phalcon/Translate/Adapter/Database.php
22/var/www/vhosts/dasapartmentliving.de/vendor/phalcon/incubator/Library/Phalcon/Translate/Adapter/Base.php
23/var/www/vhosts/dasapartmentliving.de/app/Models/Tree.php
24/var/www/vhosts/dasapartmentliving.de/app/Traits/File.php
25/var/www/vhosts/dasapartmentliving.de/vendor/phalcon/incubator/Library/Phalcon/Mvc/Model/Behavior/NestedSet.php
26/var/www/vhosts/dasapartmentliving.de/app/Models/Kategorie.php
27/var/www/vhosts/dasapartmentliving.de/app/Models/Marke.php
28/var/www/vhosts/dasapartmentliving.de/app/Models/Artikel.php
29/var/www/vhosts/dasapartmentliving.de/app/Models/Variante.php
30/var/www/vhosts/dasapartmentliving.de/app/Models/Look.php
31/var/www/vhosts/dasapartmentliving.de/app/Models/Look2Artikel.php
32/var/www/vhosts/dasapartmentliving.de/app/Widgets/Web/KategorieNaviWidget.php
33/var/www/vhosts/dasapartmentliving.de/app/Models/SocialMedia.php
34/var/www/vhosts/dasapartmentliving.de/app/Helpers/ArtikelFilter.php
35/var/www/vhosts/dasapartmentliving.de/app/Models/VarGruppe.php
Memory
Usage4194304