Phalcon Framework 3.4.4

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

/www/wwwroot/wwwpai/dayinpai/apps/commons/models/ModelCollect.php (0)
#0Apps\Commons\Models\ModelCollect->models(Array([_url] => /collection/detail/1470, [page] => 2, [uparams] => true, [0] => 1470, [albumid] => 1470))
/www/wwwroot/wwwpai/dayinpai/apps/frontend/controllers/CollectionController.php (62)
<?php
namespace Apps\Frontend\Controllers;
 
 
  /*模型收藏*/
  class CollectionController extends BaseController{
 
    public function initialize()
    {
      parent::initialize();
      $this->view->wapurl = 'http://wap.dayinpai.com/collections';
 
    }
    
    public function indexAction()
    {
      # 參數(shù)
      $params = $this->_params;
      # 實(shí)例化
      $mModel = new \Apps\Commons\Models\ModelAlubm();
      # 獲取列表
      $mModel->getList($params);
      # 獲取狀態(tài)碼
      $code  = $mModel->getCode();
      $lists = $mModel->getResponse();
      $totalDatas = $mModel->getPageTotal(); # 獲取總條數(shù)
 
      # 分頁
      $nowpage = isset($params['page'])?intval($params['page']):1;
      $perpage = $this->getDI()->getConfig()->pagesize;
      $pageurl = $this->makePageUrl(array("page"=>"{page}"));
      $pageHtml = pageHtml($totalDatas, $pageurl, $nowpage, $perpage,5);
 
      # 關(guān)鍵字獲取列表
      $mSearchModel = new \Apps\Commons\Models\Searchs();
      $mSearchModel->getList(array("type"=>"collects"));
      $searchList = $mSearchModel->getResponse();
 
 
      $this->view->keyword = $this->makePageUrl(array(),array('keywords'));
      $this->view->order = $this->makePageUrl(array(),array('order'));
      $this->view->title="3D打印模型用戶收藏專題庫 - 打印派";
      $this->view->keywords="打印派,3D模型收藏,3D打印制作,用戶喜歡的模型";
      $this->view->description="打印派用戶喜歡的、收藏的3D模型專輯庫。";
      $this->view->pageHtml = $pageHtml;
      $this->view->params = $params;
      $this->view->lists = $lists;
      $this->view->searchList = $searchList;
      $this->view->pick("model/album");
 
    }
 
    public function detailAction()
    {
 
      $params = $this->_params;
      if(!isset($params[0]) || $params[0] == 2984)
        return $this->response->setStatusCode(404, 'Not Found');
      $params['albumid'] = $params[0];
      $mModel = new \Apps\Commons\Models\ModelCollect();
      # 獲取列表
      $mModel->models($params);
      $code = $mModel->getCode();
      if($code!=0){
        return $this->response->setStatusCode(404, 'Not Found');
      }
 
      $lists = $mModel->getResponse();
      $totalDatas = $mModel->getPageTotal(); # 獲取總條數(shù)
      $album = $mModel->getAlbum(); # 獲取專輯信息
      $this->view->username = $album->user->username;
      if($this->userinfo){
 
        $iscollected = \Apps\Commons\Models\ModelCollect::count("uid = {$this->userinfo['id']} and albumid={$params['albumid']} and modelid IS NULL");
        $this->view->iscollected = $iscollected>0?true:false;
 
      }
 
      # 分頁
      $nowpage = isset($params['page'])?intval($params['page']):1;
      $perpage = $this->getDI()->getConfig()->pagesize;
      $pageurl = $this->makePageUrl(array("page"=>"{page}"));
      $pageHtml = pageHtml($totalDatas, $pageurl, $nowpage, $perpage,5);
 
      $this->view->pageHtml = $pageHtml;
      $this->view->params = $params;
      $this->view->album = $album;
      $this->view->lists = $lists;
      $this->view->pick("model/albumlist");
            $this->view->title="".$album->name."3D打印模型庫 ".$album->name."STL模型庫 由".$album->User->username."收藏整理".$album->name." - 打印派";
            $this->view->keywords="打印派,3D模型收藏,".$album->name."STL模型庫,".$album->name."模型庫";
            $this->view->description="打印派用戶".$album->User->username."收藏整理的".$album->name."3D打印模型專輯庫。";
 
    }
  }
#1Apps\Frontend\Controllers\CollectionController->detailAction(1470)
#2Phalcon\Dispatcher->callActionMethod(Object(Apps\Frontend\Controllers\CollectionController), detailAction, Array([0] => 1470))
#3Phalcon\Dispatcher->dispatch()
#4Phalcon\Mvc\Application->handle()
/www/wwwroot/wwwpai/dayinpai/public/index.php (82)
<?php
error_reporting(E_ALL & ~E_NOTICE);
 
define('PHALCONSTART', microtime(true));
define('PROJECT_PATH', dirname(dirname(__FILE__)) . '/');
 
use Phalcon\Mvc\Application,
    Phalcon\Loader;
 
date_default_timezone_set(PRC);
 
try
{
 
    define('APP_PATH', realpath(dirname(__DIR__)));
 
    define('LOCAL_PATH', dirname(dirname(__FILE__)));
 
    define('TOOL_PATH', dirname(dirname(__FILE__)) . "/tools/" );
 
    define('PAY',dirname(dirname(__FILE__)) . "/library/");
 
    $config = require PROJECT_PATH. 'config/config.php';
    //debug
    if ($config->debug)
    {
        $debug = new \Phalcon\Debug();
        $debug->listen();
    } else
    {
        error_reporting(0);
    }
 
    $loader = new Loader();
 
    $loader->registerNamespaces([
        'Apps\Commons\Models' => PROJECT_PATH . 'apps/commons/models/',
        'Library'             => PROJECT_PATH . 'library/',
    ]);
 
    $loader->registerClasses([
        'Apps\Commons\AbstractModule' => PROJECT_PATH . 'apps/commons/AbstractModule.php',
    ]);
 
    $loader->register();
 
    /**
     * Include services
     */
    require PROJECT_PATH . 'config/services.php';
    require PROJECT_PATH . 'config/repos.php';
    
    /**
     *  Read function
     */
    include PROJECT_PATH . 'config/function.php';
    /**
     * Handle the request
     */
    $application = new Application();
 
    /**
     * Assign the DI
     *
     * @var Phalcon\DI\FactoryDefault $di
     */
    $application->setDI($di);
 
    /**
     * Register application modules
     */
    $modules = [];
 
    foreach ($config->modules as $index => $modul)
    {
        $modules[$index] = [
            'className' => $modul->className,
            'path'      => $modul->dir . 'Module.php'
        ];
    }
    $application->registerModules($modules);
    $response = $application->handle();
    $response->send();
    //echo str_replace(["\n","\r","\t"], '', $response->getContent());
 
} catch (Exception $e)
{
    if (!$config->debug)
    {
        // Log the exception
        $logger = new Logger($config->application->errorLog);
        $logger->error($e->getMessage());
        $logger->error($e->getTraceAsString());
        // Show an static error page
        $response = new Response();
        $response->redirect('500');
        $response->send();
    } else
    {
        echo " PhalconException : happened in " . get_class($e) . " class <br/> \n";
        echo " ExceptionMessage : <strong style='color:red'>" . $e->getMessage() . "</strong><br/>\n";
        echo " File=" . $e->getFile();
        echo " Line=" . $e->getLine() . "<br/>\n<hr>";
        echo nl2br(htmlentities($e->getTraceAsString()));
    }
}
KeyValue
_url/collection/detail/1470
page2
uparamstrue
KeyValue
USERwww
HOME/home/www
SCRIPT_NAME/index.php
REQUEST_URI/collection/detail/1470?page=2&uparams=true
QUERY_STRING_url=/collection/detail/1470&page=2&uparams=true
REQUEST_METHODGET
SERVER_PROTOCOLHTTP/1.1
GATEWAY_INTERFACECGI/1.1
REDIRECT_QUERY_STRING_url=/collection/detail/1470&page=2&uparams=true
REDIRECT_URL/collection/detail/1470
REMOTE_PORT58198
SCRIPT_FILENAME/www/wwwroot/wwwpai/dayinpai/public/index.php
SERVER_ADMINwebmaster@example.com
CONTEXT_DOCUMENT_ROOT/www/wwwroot/wwwpai/dayinpai/public
CONTEXT_PREFIX
REQUEST_SCHEMEhttp
DOCUMENT_ROOT/www/wwwroot/wwwpai/dayinpai/public
REMOTE_ADDR104.243.133.226
SERVER_PORT80
SERVER_ADDR10.1.8.14
SERVER_NAMEm.teenpicscenter.com
SERVER_SOFTWAREApache
SERVER_SIGNATURE<address>Apache Server at m.teenpicscenter.com Port 80</address>\n
LD_LIBRARY_PATH/www/server/apache/lib
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_HOSTm.teenpicscenter.com
HTTP_USER_AGENTMozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
HTTP_REFERERhttp://www.baidu.com
HTTP_COOKIEt=92d7540e476b153862b4ea2356ede7b3; r=8148
HTTP_ACCEPT_LANGUAGEzh-CN,zh
HTTP_ACCEPT_ENCODINGgzip, deflate
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
CONTENT_TYPEapplication/x-www-form-urlencoded; Charset=UTF-8
HTTP_CONNECTIONKeep-Alive
proxy-nokeepalive1
REDIRECT_STATUS200
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1734888656.0682
REQUEST_TIME1734888656
#Path
0/www/wwwroot/wwwpai/dayinpai/public/index.php
1/www/wwwroot/wwwpai/dayinpai/config/config.php
2/www/wwwroot/wwwpai/dayinpai/config/services.php
3/www/wwwroot/wwwpai/dayinpai/config/repos.php
4/www/wwwroot/wwwpai/dayinpai/config/function.php
5/www/wwwroot/wwwpai/dayinpai/apps/frontend/config/routes.php
6/www/wwwroot/wwwpai/dayinpai/apps/backend/config/routes.php
7/www/wwwroot/wwwpai/dayinpai/apps/api/config/routes.php
8/www/wwwroot/wwwpai/dayinpai/apps/frontend/Module.php
9/www/wwwroot/wwwpai/dayinpai/apps/commons/AbstractModule.php
10/www/wwwroot/wwwpai/dayinpai/apps/frontend/config/config.php
11/www/wwwroot/wwwpai/dayinpai/apps/frontend/controllers/CollectionController.php
12/www/wwwroot/wwwpai/dayinpai/apps/frontend/controllers/BaseController.php
13/www/wwwroot/wwwpai/dayinpai/apps/commons/models/ModelCollect.php
14/www/wwwroot/wwwpai/dayinpai/cache/metaData/map-apps_commons_models_modelcollect.php
15/www/wwwroot/wwwpai/dayinpai/cache/metaData/meta-apps_commons_models_modelcollect-model_collect.php
16/www/wwwroot/wwwpai/dayinpai/apps/commons/models/ModelAlubm.php
17/www/wwwroot/wwwpai/dayinpai/cache/metaData/map-apps_commons_models_modelalubm.php
18/www/wwwroot/wwwpai/dayinpai/cache/metaData/meta-apps_commons_models_modelalubm-model_album.php
19/www/wwwroot/wwwpai/dayinpai/apps/commons/models/Model.php
20/www/wwwroot/wwwpai/dayinpai/cache/metaData/map-apps_commons_models_model.php
21/www/wwwroot/wwwpai/dayinpai/cache/metaData/meta-apps_commons_models_model-model.php
22/www/wwwroot/wwwpai/dayinpai/apps/commons/models/User.php
23/www/wwwroot/wwwpai/dayinpai/cache/metaData/map-apps_commons_models_user.php
24/www/wwwroot/wwwpai/dayinpai/cache/metaData/meta-apps_commons_models_user-user.php
25/www/wwwroot/wwwpai/dayinpai/apps/commons/models/Comment.php
26/www/wwwroot/wwwpai/dayinpai/cache/metaData/map-apps_commons_models_comment.php
27/www/wwwroot/wwwpai/dayinpai/cache/metaData/meta-apps_commons_models_comment-comment.php
Memory
Usage4194304