CodeIgniter Forums
[solved]Error Undefined property: - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [solved]Error Undefined property: (/showthread.php?tid=43594)



[solved]Error Undefined property: - El Forum - 07-17-2011

[eluser]brucebat[/eluser]
I have found the source of a new problem when calling my model function?

-I have checked my variables being passed that they are initilized!
-I have ensure the datbase library is autoloaded
-I have located the where the error is occurring see below.


Error:
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined property: Submit::$create_record

Filename: core/Model.php

Line Number: 50


Code:
$this->load->model('submit_model');
echo "test breakpoint";       return;                                                           $this->submit_model->create_record($completedstaffrows, $completedeventrows); //error happens here?

Would a constructor fix this?


Function declaration in the model called Submit_model
Code:
public function create_record($completedstaffrows , $completedeventrows)
        {
        
             //code here
                 }



[solved]Error Undefined property: - El Forum - 07-17-2011

[eluser]Aken[/eluser]
Object property:
Code:
$object->create_record

Object function:
Code:
$object->create_record($parameter, $parameter)



[solved]Error Undefined property: - El Forum - 07-18-2011

[eluser]brucebat[/eluser]
That does not seem to work.

I checked my autoloading of the model class and it is fine.

The function works fine also and submits to the database so unless this is a minor glitch (any way to remove the notification of the error).


[solved]Error Undefined property: - El Forum - 07-18-2011

[eluser]TheBaron[/eluser]
This isn't an error. Its a notice. It is there because of what Aken said.

Somewhere you have done this.

Either outside of the model you have done this...

Code:
$this->submit_model->create_record;

Or inside the model you have done this.

Code:
$this->create_record

If all you are doing is calling the model, then exiting, I would suggest you check your constructor function.


[solved]Error Undefined property: - El Forum - 07-18-2011

[eluser]brucebat[/eluser]
Fixed it .

Was caused by a if statement on the function which did not have the "()" at the end.

Thanks for the help!