Error
Call to a member function getUnit() on bool Error thrown with message "Call to a member function getUnit() on bool" Stacktrace: #2 Error in /home/f07c9ogk/public_html/functions.php:905 #1 crm_get_each_unit_by_id in /home/f07c9ogk/public_html/src/data/unit.php:4 #0 include in /home/f07c9ogk/public_html/index.php:422
Stack frames (3):
2 Error
…/­functions.php905
1 crm_get_each_unit_by_id
…/­src/­data/­unit.php4
0 include
…/­index.php422
/home/f07c9ogk/public_html/functions.php
}

function crm_get_each_unit_by_id( $id = '' ) {
    $slug_new = explode("-", $id);
    global $cache, $client;
    $collectunits = $cache->get( 'crm_each_unit_'.end($slug_new) );
    //if( false == $collectunits || EL_CACHE_DISABLED ) {
    if( true || EL_CACHE_DISABLED ) {
        $collectunits = $client->getUnit(end($slug_new));

        $cache->set( 'crm_each_unit_'.end($slug_new), $collectunits );

    }
    return $collectunits;

}

function crm_get_units_by_developer( $developer_id = 0 ) {
    global $cache;
/home/f07c9ogk/public_html/src/data/unit.php
<?php
error_reporting(0);
$slug_new = explode("-", $slug);
$eachunit = crm_get_each_unit_by_id( $slug );
//echo "Slugify : ".slugify($eachunit[0]['project']);
$projectid = crm_get_project_id( slugify($eachunit[0]['project']) );

if($projectid[1]){
    $project = crm_get_project( $projectid[1] );
    $projectObj = new Project( $project );
    if(!empty($projectObj)){
        $favicon = $projectObj->getDeveloperLogo();
        $metaimg = $projectObj->getMetaimg();
    }

    $add_title = (!empty($eachunit[0]['rooms'])) ? $eachunit[0]['rooms'].' Bedrooms ' : (number_format($eachunit[0]['bua'],2) + 0 )." sqm " ;
    $final = $add_title . $eachunit[0]['type'] . " for sale in " . $getName . ', ' . $eachunit[0]['district'];
    $unitUrl = "https://elbayt.com/unit/".$slug;

    // $schema_output = \JsonLd\Context::create('product', [
/home/f07c9ogk/public_html/index.php
 
 
    if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start();
     
    if(! $_route ) {
        $_route = '404';
    }
 
    $file = sprintf(__DIR__.'/src/data/%s.php', $_route);
    if( file_exists($file) ) include $file;
    if( $_route != 'sitemap' && !$amp ) {
        //echo "<script>console.log('Debug Objects: " . $_route . "' );</script>";
        if (in_array($_route, array("webchat", "footer-load", "homepage-load", "homepage-mobile-load"))){
            include sprintf(__DIR__.'/src/pages/%s.php', $_route);
        }/* elseif (!(in_array($_route, array("homepage-test", "units", "unit", "project")))){
            if(!$hidehtml) include __DIR__.'/src/pages/header.php'; 
            include sprintf(__DIR__.'/src/pages/%s.php', $_route);
            if(!$hidehtml) include __DIR__.'/src/pages/footer.php';
        }*/ else {  
            if(!$hidehtml) include __DIR__.'/src/pages/header.php'; 

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE Apache
REQUEST_URI /en/unit/villa-for-sale-in-karma-4-sheikh-zayed-2727
USER f07c9ogk
HOME /home/f07c9ogk
SCRIPT_NAME /index.php
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/2.0
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /en/unit/villa-for-sale-in-karma-4-sheikh-zayed-2727
REMOTE_PORT 55556
SCRIPT_FILENAME /home/f07c9ogk/public_html/index.php
SERVER_ADMIN webmaster@elbayt.com
CONTEXT_DOCUMENT_ROOT /home/f07c9ogk/public_html
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /home/f07c9ogk/public_html
REMOTE_ADDR 3.237.51.235
SERVER_PORT 443
SERVER_ADDR 162.240.238.231
SERVER_NAME elbayt.com
SERVER_SIGNATURE
PATH /usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/opt/bin
HTTP_HOST elbayt.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
proxy-nokeepalive 1
H2_STREAM_TAG 19899-3086-3
H2_STREAM_ID 3
H2_PUSHED_ON
H2_PUSHED
H2_PUSH off
H2PUSH off
HTTP2 on
SSL_TLS_SNI elbayt.com
HTTPS on
UNIQUE_ID ZgVy-OVGeglZUT5qGBizHgAAUAM
REDIRECT_STATUS 200
REDIRECT_H2_STREAM_TAG 19899-3086-3
REDIRECT_H2_STREAM_ID 3
REDIRECT_H2_PUSHED_ON
REDIRECT_H2_PUSHED
REDIRECT_H2_PUSH off
REDIRECT_H2PUSH off
REDIRECT_HTTP2 on
REDIRECT_SSL_TLS_SNI elbayt.com
REDIRECT_HTTPS on
REDIRECT_UNIQUE_ID ZgVy-OVGeglZUT5qGBizHgAAUAM
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711633144.6144
REQUEST_TIME 1711633144
argv Array ( )
argc 0
empty
0. Whoops\Handler\PrettyPageHandler