Cannot use object of type Cake\ORM\Query as array 📋

Error
Toggle Vendor Stack Frames
            //pageTitle:
            $this->pageTitle 'Csatornák ';
            if ($cat != null) {
                $category $this->Tvcats->findById($cat);
                $this->pageTitle .= ' / ' $category['name'];
            }
            if ($ch != null) {
                $channel $this->Tvchannels->findById($ch);
                $this->pageTitle .= ' / ' $channel['name'];
Error in: ROOT/src/Controller/TvchannelsController.php, line 43

If you want to customize this error message, create templates/Error/error500.php