Phalcon Framework 5.8.0

TypeError: Actiage\Front\Controller\Appointment\AppointmentsViewGetController::setReviews(): Argument #1 ($consultId) must be of type string, null given, called in /var/www/html/actiage/releases/20241219125226/src/front/Controller/Appointment/AppointmentsViewGetController.php on line 64

/var/www/html/actiage/releases/20241219125226/src/front/Controller/Appointment/AppointmentsViewGetController.php (107)
#0Actiage\Front\Controller\Appointment\AppointmentsViewGetController->setReviews
/var/www/html/actiage/releases/20241219125226/src/front/Controller/Appointment/AppointmentsViewGetController.php (64)
<?php
 
namespace Actiage\Front\Controller\Appointment;
 
use Actiage\Front\Controller\BaseController;
use Actiage\Shared\Infraestructure\ConsultsAppointments\ConsultsAppointmentsGetBySlug;
use Actiage\Shared\Lib\Utils\Language;
use Actiage\Shared\Models\ConsultasCitas;
use Actiage\Shared\Models\ConsultasUsuariosReviews;
use Actiage\Shared\Models\Paises;
use Actiage\Shared\Models\Provincias;
use Actiage\Shared\Models\Usuarios;
use Phalcon\Html\Escaper;
use Phalcon\Html\Helper\Input\Select;
 
/**
 * Class AppointmentsViewGetController
 */
final class AppointmentsViewGetController extends BaseController
{
 
    private $slug;
    public function initialize()
    {
        $this->jsFiles = [
            'js/shop/star-rating.js',          
            'js/country.js',
        ];
        parent::initialize();
    }
    /**
     * Vemos más a fondo el tipo de consulta que es
     * @param string $slug
     * @return void
     */
    public function viewAction(string $slug = '')
    {
        if (empty($slug)) {
            $this->throw404();
        }
        $this->slug = $slug;
        $this->view->userDataCompleted = $this->checkAllData();
        if (!empty($this->user) && !$this->view->userDataCompleted) {
           $this->setUserDataModal();
        }
        $consult = (new ConsultsAppointmentsGetBySlug())->get($slug)->toArray();
 
        if (!$consult) {
            $this->throw404();
        }
 
        $country = $this->getCountryFromCookie();
         if ($country == Paises::UNITED_STATES) {
            $path = Language::ENGLISH;
        } elseif ($country == Paises::SPAIN) {
            $path = Language::SPANISH;
        } else {
            $path = Language::ENGLISH;
        }
        $this->view->appointmentPath = $path;
        $this->view->consult = $consult;
        $this->view->titleSeo = $consult[0]['ConsultasCitas']->nombre;
        $this->view->descriptionSeo = $consult[0]['ConsultasCitas']->nombre;
        $this->setReviews($consult[0]['ConsultasCitas']->id);
        $this->view->classSpecialLayout = 'ficha-cita';
         $countryCookie = $this->getCountryNavFromCookie();
        if ($countryCookie != Paises::SPAIN) {
            $this->view->urlCanonical = DOMINIO . str_replace('-' . $countryCookie, '', $_SERVER['REQUEST_URI']);
        }
        $this->view->language = $this->getLang();
        $this->view->whatsapp = true;
        $this->assets->addJs('/js/general-consults.js');
        $this->view->blank = true;
        $this->view->containerDiv = '1s';
        if ($slug !== 'consulta-de-50-minutos') {
            $this->view->treatment = '-tratamiento';
        } else {
            $this->view->treatment = '';
        }
 
 
        $this->view->pick('appointment/view');
    }
 
    /**
     * Comprobar que la url coincide con el pais
     * @param string $slug
     * @return void
     */
    private function checkUrlCountry(string $slug = '')
    {
        $country = $this->getCountryNavFromCookie();
        if ($country == Paises::UNITED_STATES || $country == Paises::ALL) {
            $this->response->redirect('/en/anti-aging-medical-consultations/' . $slug);
            return;
        } elseif ($country == Paises::SPAIN) {
            $this->response->redirect('/es/consultas-medicas-antienvejecimiento/' . $slug);
            return;
        }
    }
 
    /**
     * @param string $consultId
     * @param string $source
     * @return void
     */
    private function setReviews(string $consultId = '', string $source = ''): void
    {
        if (!empty($consultId)) {
            $params['conditions'] = 'activo = 1 AND consultas_citas_id = ' . $consultId;
        } elseif ($source == 'consultas') {
            $params['conditions'] = 'activo = 1 AND consultas_citas_id IS NOT NULL';
        } else {
            $params['conditions'] = 'activo = 1';
        }
 
        $params['limit'] = '3';
        $params['order'] = 'id DESC';
        $this->view->reviews = ConsultasUsuariosReviews::find($params);
        // $this->view->showFontAwesomeRating = true;
 
        $paramsConsultas['conditions'] = 'activo = 1';
        $paramsConsultas['order'] = 'orden';
        $consults = ConsultasCitas::find($paramsConsultas);
        $consultList = [];
        foreach ($consults as $consult) {
            $consultList[$consult->id] = $consult->nombre;
        }
        $this->view->consultNames = $consultList;
    }
 
    /**
     * @return bool
     */
    private function checkAllData(): bool
    {
        if(!isset($this->user['id'])) {
            return true;
        }
        $user = Usuarios::findFirstByid($this->user['id']);
        if ($user) {
 
            if (empty($user->nombre) || empty($user->apellidos) || empty($user->telefono)
                || empty($user->pais_id)
                || (empty($user->provincia_id) && $user->pais_id == Paises::ESPANA)
                || empty($user->fecha_nacimiento) || empty($user->dni) || empty($user->direccion)
                || empty($user->cp) || empty($user->localidad)
                || empty($user->genero_id)
            ) {
                return false;
            }
        }
 
        return true;
    }
 
    private function setUserDataModal() {
 
        $this->view->urlBack = $this->SecurePlugin->encrypt('/consultas-medicas-antienvejecimiento/' . $this->slug);
        $this->view->countries = Paises::find(['order' => 'nombre', 'conditions' => 'activo = 1']);
        $this->view->selectInputCountries = new Select(new Escaper());
        $this->view->selectInputStates  = new Select(new Escaper());
        $this->view->selectInputGenders = new Select(new Escaper());
        $this->view->selectInputBirthDays  = new Select(new Escaper());
        $this->view->selectInputBirthMonths  = new Select(new Escaper());
        $this->view->selectInputBirthYears  = new Select(new Escaper());
        $this->view->birthDay = '';
        $this->view->birthMonth = '';
        $this->view->birthYear = '';
 
        $errors = [];
        $user = Usuarios::findFirst($this->user['id']);
 
        if (empty($user->pais_id)) {
            $this->view->states = Provincias::find(['conditions' => 'pais_id = ' . Paises::ESPANA, 'order' => 'provincia']);
        } else {
            $this->view->states = Provincias::find(['conditions' => 'pais_id = ' . $user->pais_id, 'order' => 'provincia']);
        }
 
        if (!empty($user->fecha_nacimiento)) {
            $date = explode('-', $user->fecha_nacimiento);
            if (isset($date[2])) {
                $this->view->birthDay = ltrim($date[2], '0') ?? '';
            }
            if (isset($date[1])) {
                $this->view->birthMonth = ltrim($date[1], '0') ?? '';
            }
            if (isset($date[0])) {
                $this->view->birthYear = $date[0] ?? '';
            }
        }
        $this->view->birthDays = $this->CalendarPlugin->getDays();
        $this->view->birthMonths = $this->CalendarPlugin->getMonths();
        $this->view->birthYears = $this->CalendarPlugin->getYears();
        if (empty($user->pais_id)) {
            $this->view->states = Provincias::find(['conditions' => 'pais_id = ' . Paises::ESPANA, 'order' => 'provincia']);
        } else {
            $this->view->states = Provincias::find(['conditions' => 'pais_id = ' . $user->pais_id, 'order' => 'provincia']);
        }
        $this->view->genders = [
            '1' => 'Hombre',
            '2' => 'Mujer',
        ];
 
        $this->view->user = $user;
        $this->view->errors = $errors;
    }
 
}
#1Actiage\Front\Controller\Appointment\AppointmentsViewGetController->viewAction
#2Phalcon\Dispatcher\AbstractDispatcher->callActionMethod
#3Phalcon\Dispatcher\AbstractDispatcher->dispatch
#4Phalcon\Mvc\Application->handle
/var/www/html/actiage/releases/20241212180134/public/index.php (84)
<?php
use Phalcon\Di\FactoryDefault;
use Phalcon\Logger\AbstractLogger;
use Phalcon\Logger\Adapter\Stream;
use Phalcon\Logger\Logger;
use Phalcon\Mvc\Application;
use Phalcon\Support\Debug;
 
$debug = new Debug();
$debug->listen();
error_reporting(E_ALL);
 
define('BASE_PATH', dirname(__DIR__));
define('APP_PATH', BASE_PATH . '/src');
 
/**
 * The FactoryDefault Dependency Injector automatically registers
 * the services that provide a full stack framework.
 */
$di = new FactoryDefault();
 
/**
 * Entornos de desarrollo disponibles y variables de entorno
 */
include APP_PATH . '/config/environment.php';
 
/**
 * Información listas en klaviyo
 */
include APP_PATH . '/config/klaviyo.php';
 
/**
 * Read services
 */
include APP_PATH . '/config/services.php';
 
/**
 * Handle routes
 */
include APP_PATH . '/config/router.php';
 
/**
 * Get config service for use in inline setup below
 */
$config = $di->get('config');
 
/**
 * Include Autoloader
 */
include APP_PATH . '/config/loader.php';
 
 
/**
 * Handle the request
 */
$application = new Application($di);
 
$application->registerModules(
    [
        'admin' => [
            'className' => Actiage\Admin\Module::class,
            'path'      => '../src/admin/Module.php',
        ],
        'doctor'  => [
            'className' => Actiage\Doctor\Module::class,
            'path'      => '../src/doctor/Module.php',
        ],
        'sponsor'  => [
            'className' => Actiage\Sponsor\Module::class,
            'path'      => '../src/sponsor/Module.php',
        ],
        'user'  => [
            'className' => Actiage\User\Module::class,
            'path'      => '../src/user/Module.php',
        ],
        'front'  => [
            'className' => Actiage\Front\Module::class,
            'path'      => '../src/front/Module.php',
        ]
    ]
);
 try {
    if(ENVIRONMENT != DEVELOPMENT) {
        echo str_replace(['\n', '\r', '\t'], '', $application->handle($_SERVER['REQUEST_URI'])->getContent());
    } else {
        echo $application->handle($_SERVER['REQUEST_URI'])->getContent();
    }
 } catch (\Exception $e) {
    $debugFile = new Stream(BASE_PATH . '/tmp/logs/error.log');
 
    $message = get_class($e) . ': ' . $e->getMessage() . '\n' . ' File=' . $e->getFile() . '\n' . ' Line=' . $e->getLine() . '\n' . $e->getTraceAsString() . '\n';
    $message .= $_SERVER['REQUEST_URI'] . '\n';
    $logger = new Logger('errorLog', ['main' => $debugFile]);
    $logger->log(AbstractLogger::CRITICAL,$message);
    $debugFile->close();
}
 
KeyValue
_url/consultas-medicas-antienvejecimiento/antienvejecimiento-compact-united-states
KeyValue
USERnginx
HOME/var/lib/nginx
HTTP_ACCEPT_ENCODINGgzip, br, zstd, deflate
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT*/*
HTTP_HOSTactiage.es
REDIRECT_STATUS200
SERVER_NAMEactiage.es
SERVER_PORT443
SERVER_ADDR51.77.247.31
REMOTE_PORT54251
REMOTE_ADDR18.224.70.133
SERVER_SOFTWAREnginx/1.20.1
GATEWAY_INTERFACECGI/1.1
HTTPSon
REQUEST_SCHEMEhttps
SERVER_PROTOCOLHTTP/2.0
DOCUMENT_ROOT/var/www/html/actiage/current/public
DOCUMENT_URI/index.php
REQUEST_URI/consultas-medicas-antienvejecimiento/antienvejecimiento-compact-united-states
SCRIPT_NAME/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHODGET
QUERY_STRING_url=/consultas-medicas-antienvejecimiento/antienvejecimiento-compact-united-states&
SCRIPT_FILENAME/var/www/html/actiage/current/public/index.php
APPLICATION_ENVproduction
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1734784296.4526
REQUEST_TIME1734784296
#Path
0/var/www/html/actiage/releases/20241212180134/public/index.php
1/var/www/html/actiage/shared/environment.php
2/var/www/html/actiage/shared/klaviyo.php
3/var/www/html/actiage/releases/20241212180134/src/config/services.php
4/var/www/html/actiage/releases/20241212180134/src/config/router.php
5/var/www/html/actiage/releases/20241212180134/src/front/router.php
6/var/www/html/actiage/releases/20241212180134/src/admin/router.php
7/var/www/html/actiage/releases/20241212180134/src/doctor/router.php
8/var/www/html/actiage/releases/20241212180134/src/user/router.php
9/var/www/html/actiage/releases/20241212180134/src/sponsor/router.php
10/var/www/html/actiage/shared/config.php
11/var/www/html/actiage/releases/20241212180134/src/config/loader.php
12/var/www/html/actiage/shared/vendor/autoload.php
13/var/www/html/actiage/shared/vendor/composer/autoload_real.php
14/var/www/html/actiage/shared/vendor/composer/platform_check.php
15/var/www/html/actiage/shared/vendor/composer/ClassLoader.php
16/var/www/html/actiage/shared/vendor/composer/autoload_static.php
17/var/www/html/actiage/shared/vendor/symfony/polyfill-mbstring/bootstrap.php
18/var/www/html/actiage/shared/vendor/symfony/polyfill-mbstring/bootstrap80.php
19/var/www/html/actiage/shared/vendor/symfony/deprecation-contracts/function.php
20/var/www/html/actiage/shared/vendor/symfony/polyfill-ctype/bootstrap.php
21/var/www/html/actiage/shared/vendor/symfony/polyfill-ctype/bootstrap80.php
22/var/www/html/actiage/shared/vendor/react/promise/src/functions_include.php
23/var/www/html/actiage/shared/vendor/react/promise/src/functions.php
24/var/www/html/actiage/shared/vendor/symfony/polyfill-php80/bootstrap.php
25/var/www/html/actiage/shared/vendor/symfony/polyfill-intl-grapheme/bootstrap.php
26/var/www/html/actiage/shared/vendor/symfony/polyfill-intl-normalizer/bootstrap.php
27/var/www/html/actiage/shared/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php
28/var/www/html/actiage/shared/vendor/ralouphie/getallheaders/src/getallheaders.php
29/var/www/html/actiage/shared/vendor/symfony/string/Resources/functions.php
30/var/www/html/actiage/shared/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php
31/var/www/html/actiage/shared/vendor/symfony/var-dumper/Resources/functions/dump.php
32/var/www/html/actiage/shared/vendor/guzzlehttp/guzzle/src/functions_include.php
33/var/www/html/actiage/shared/vendor/guzzlehttp/guzzle/src/functions.php
34/var/www/html/actiage/shared/vendor/psy/psysh/src/functions.php
35/var/www/html/actiage/shared/vendor/symfony/polyfill-php81/bootstrap.php
36/var/www/html/actiage/shared/vendor/digitalbazaar/json-ld/jsonld.php
37/var/www/html/actiage/shared/vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php
38/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/_bootstrap.php
39/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/all.php
40/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/any.php
41/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/apply.php
42/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/assoc.php
43/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/butlast.php
44/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/complement.php
45/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/compose.php
46/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/constant.php
47/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/dissoc.php
48/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/do_if.php
49/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/each.php
50/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/filter.php
51/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/filter_fresh.php
52/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/filter_null.php
53/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/first.php
54/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/flat_map.php
55/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/flatten.php
56/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/get.php
57/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/get_each.php
58/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/get_in.php
59/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/group_by.php
60/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/key.php
61/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/identity.php
62/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/instance_of.php
63/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/last.php
64/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/map.php
65/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/memoize.php
66/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/not.php
67/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/partial.php
68/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/partition.php
69/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/pipe.php
70/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/reduce.php
71/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/reindex.php
72/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/repeat.php
73/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/rest.php
74/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/reverse.php
75/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/search.php
76/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/some.php
77/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/sort.php
78/var/www/html/actiage/shared/vendor/lambdish/phunctional/src/to_array.php
79/var/www/html/actiage/shared/vendor/mpdf/mpdf/src/functions.php
80/var/www/html/actiage/shared/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php
81/var/www/html/actiage/shared/vendor/ramsey/uuid/src/functions.php
82/var/www/html/actiage/releases/20241219125226/src/front/Module.php
83/var/www/html/actiage/releases/20241219125226/src/front/Controller/Appointment/AppointmentsViewGetController.php
84/var/www/html/actiage/releases/20241219125226/src/front/Controller/BaseController.php
85/var/www/html/actiage/releases/20241212180134/src/Shared/plugins/TimeZonePlugin.php
86/var/www/html/actiage/releases/20241212180134/src/middleware/MiddleWareView.php
87/var/www/html/actiage/shared/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php
88/var/www/html/actiage/releases/20241212180134/src/Shared/library/Utils/Device.php
89/var/www/html/actiage/releases/20241212180134/src/Shared/models/Cookies.php
90/var/www/html/actiage/releases/20241212180134/src/Shared/models/ModelBase.php
91/var/www/html/actiage/releases/20241212180134/src/Shared/models/Paises.php
92/var/www/html/actiage/releases/20241212180134/src/Shared/plugins/CommonPlugin.php
93/var/www/html/actiage/releases/20241212180134/src/Shared/library/Utils/Slug.php
94/var/www/html/actiage/releases/20241212180134/src/Shared/library/Utils/Currency.php
95/var/www/html/actiage/releases/20241212180134/src/Shared/plugins/BotsPlugin.php
96/var/www/html/actiage/releases/20241212180134/src/Shared/plugins/RobotsPlugin.php
97/var/www/html/actiage/releases/20241212180134/src/Shared/plugins/RedisPlugin.php
98/var/www/html/actiage/releases/20241212180134/src/Shared/library/Utils/Image.php
99/var/www/html/actiage/releases/20241212180134/src/Shared/plugins/JsPlugin.php
100/var/www/html/actiage/shared/vendor/matthiasmullie/minify/src/JS.php
101/var/www/html/actiage/shared/vendor/matthiasmullie/minify/src/Minify.php
102/var/www/html/actiage/releases/20241212180134/src/Shared/plugins/CssPlugin.php
103/var/www/html/actiage/releases/20241212180134/src/Shared/models/Roles.php
104/var/www/html/actiage/releases/20241212180134/src/Shared/models/Provincias.php
105/var/www/html/actiage/releases/20241212180134/src/Shared/plugins/SeoPlugin.php
106/var/www/html/actiage/releases/20241212180134/src/Shared/models/SemaforoCritical.php
107/var/www/html/actiage/releases/20241212180134/src/Shared/Infraestructure/ConsultsAppointments/ConsultsAppointmentsGetBySlug.php
108/var/www/html/actiage/releases/20241212180134/src/Shared/models/ConsultasCitas.php
109/var/www/html/actiage/releases/20241212180134/src/Shared/models/ConsultasCitasSesiones.php
110/var/www/html/actiage/releases/20241212180134/src/Shared/library/Utils/Language.php
Memory
Usage2097152