CodeIgniter Forums
Casting variable to my class - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Casting variable to my class (/showthread.php?tid=71929)



Casting variable to my class - omid_student - 10-12-2018

Hi
I have two class in php file
Below code is my php file
There are no problem in this code
My only problem is PHPStorm cannot show class fields
But when i delcare example $user = new user(); and when i use $user-> , PHPStorm show fields
I need casting variable to user class to show field when i try use this class

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
Test extends CI_Controller
{

 
   function __construct()
 
   {
 
       parent::__construct();
 
   }

 
   function index() {

 
       $this->db->select('first_name,last_name');
 
       $user_c  $this->db->get('user')->row(0,'user');
 
       echo $user_c->first_name;

 
   }

}

class 
user {
 
   var $first_name;
 
   var $last_name;


This picture is when i use class directly
   

And this picture when i use only variable