title: Object of class __PHP_Incomplete_Class could not be converted to string
body: <p>Hi I have this error <code>"Catchable fatal error: Object of class __PHP_Incomplete_Class could not be converted to string  in C:\xampp\htdocs\ProjectTA\dao\CustomerDao.php on line 161"</code> like this, I have no idea to solve this problem I check all and everything is fine to me</p>
  
  <p>this my Customer dao</p>
  
  <pre><code>  public function getOneCustomer($id) {
          try {
              $conn = Connection::getConnection();
              $query = "select * from Customer c join Company comp on c.Company_IdCompany = comp.IdCompany JOIN City cit ON c.City_Id = cit.IdC WHERE c.IdCustomer = ?";
              $stmt = $conn-&gt;prepare($query);
              $stmt-&gt;bindParam(1, $id);
              $stmt-&gt;execute();
              $row = $stmt-&gt;fetch();
  
  
              $customer = new Customer();
              $customer-&gt;setIdCustomer($row['IdCustomer']);
              $customer-&gt;setCustomerName($row['CustomerName']);
              $customer-&gt;setPhoneNumber($row['PhoneNumber']);
              $customer-&gt;setBankNumber($row['BankNumber']);
              $customer-&gt;setCAddress($row['AddressC']);
              $customer-&gt;setCEmail($row['EmailC']);
              $customer-&gt;setPassword($row['Password']);
              $customer-&gt;setCustomerStatus($row['CustomerStatus']);
              $customer-&gt;setPhoto($row['Photo']);
  
              $company = new Company();
              $company-&gt;setIdCompany($row['IdCompany']);
              $company-&gt;setCompanyName($row['CompanyName']);
              $company-&gt;setWebsite($row['Website']);
              $company-&gt;setPhone($row['Phone']);
              $company-&gt;setEmail($row['Email']);
              $company-&gt;setAddress($row['Address']);
              $company-&gt;setLogo($row['Logo']);
  
              $city = new city();
              $city-&gt;setIdC($row['IdC']);
              $city-&gt;setNameC($row['NameC']);
  
              $customer-&gt;setCompany_IdCompany($company);
              $customer-&gt;setCity_Id($city);
          } catch (PDOexception $e) {
              echo $e-&gt;getMessage();
              die();
          }
          $conn = null;
          return $customer;
      }
  </code></pre>
  
  <p>and I want to display this in my customer view </p>
  
  <pre><code>&lt;?php
  
    if (isset($_SESSION['IdCustomer'])) {
        $dao = new CustomerDao();
        $id = $_SESSION['IdCustomer'];
        $dataInfo = $dao-&gt;getOneCustomer($id);
  
  
    echo '&lt;div class="col-md-12"&gt;
            &lt;div id="fh5co-tab-feature-vertical" class="fh5co-tab"&gt;
                  &lt;ul class="resp-tabs-list hor_1"&gt;
                          &lt;li&gt;&lt;i class="fh5co-tab-menu-icon ti-ruler-pencil"&gt;&lt;/i&gt; Company&lt;/li&gt;
                          &lt;li&gt;&lt;i class="fh5co-tab-menu-icon ti-paint-bucket"&gt;&lt;/i&gt; Project &amp; Task&lt;/li&gt;
                          &lt;li&gt;&lt;i class="fh5co-tab-menu-icon ti-shopping-cart"&gt;&lt;/i&gt; Proof of Payment&lt;/li&gt;
                  &lt;/ul&gt;
                  &lt;div class="resp-tabs-container hor_1"&gt;
                      &lt;div&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-md-12"&gt;
                                      &lt;h2 class="h3"&gt;Company&lt;/h2&gt;
                              &lt;/div&gt;
                              &lt;div class="col-md-6"&gt;
                                    &lt;h2&gt;'.$dataInfo-&gt;getCustomerName().'&lt;/h2&gt; // i want diplay customer name
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;';
  }?&gt;
  </code></pre>
  
  <p>Thank You</p>