Welcome Guest, Not a member yet? Register   Sign In
Library -Object - Hydrate
#3

That's a part of the answer. I was sure my old logic was wrong. No hydrate then. 

But how do I 'intent' or 'populate' my object then. 

I have my controller with my form validation. 
- InputName
- InputFirstname

If validation true then go to my call 'member' and use the function create member :
PHP Code:
public function CheckSignUp ()
 
   {
 
       $this->form_validation->set_rules('InputName''Name' ,'trim|required');
 
       $this->form_validation->set_rules('InputFirstName''First Name' ,'trim|required');        

        
        if 
($this->form_validation->run() == false)
 
       {
 
           $this->load->view('sign/signUp');
 
       }
 
       else
        
{
 
           $this->MemberModel->createmember();
 
       }
 
   

   
PHP Code:
       function createmember()
 
       {
 
        $member = new Member([   
        
'MEMBER_NAME'              => $this->input->post('InputName')
 
       'MEMBER_FRIST_NAME     => $this->input->post('InputFirstName') 
        ]);
        } 

And in my library 'member' : 
PHP Code:
class Member
{//ATTRIBUTES
    
protected     $_MEMBER_ID,
             
$_MEMBER_EMAIL,
             
$_MEMBER_NAME,
            
$_MEMBER_FIRST_NAME,
             
$_MEMBER_BIRTH_DAY,
             
$_MEMBER_ACCOUNT_MANAGER,
             
$_MEMBER_CREATION_DATE,
             
$_MEMBER_ACCOUNT_ID,
             
$_MEMBER_ADMIN,
            
$_MEMBER_PASS,
            
$_MEMBER_LOG_TIME,
            
$_MEMBER_NUM_CONNECT;
 public function 
__construct()
        {
                    
        }



I still miss something right ? when I do a var_dump of my $member all the value are set to NULL. this is why I wanted a 'hydrate'...
Reply


Messages In This Thread
Library -Object - Hydrate - by martin88 - 11-14-2016, 02:36 PM
RE: Library -Object - Hydrate - by ciadmin - 11-14-2016, 03:03 PM
RE: Library -Object - Hydrate - by martin88 - 11-14-2016, 03:21 PM
RE: Library -Object - Hydrate - by ciadmin - 11-14-2016, 04:05 PM
RE: Library -Object - Hydrate - by Narf - 11-15-2016, 02:56 AM
RE: Library -Object - Hydrate - by martin88 - 11-16-2016, 03:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB