[eluser]zelenkooo[/eluser]
Am total begging and am trying to do very simple thing
here is my model class
Code:
class Person extends CI_Model {
var $name = '';
function __construct()
{
parent::__construct();
}
function initialise($name)
{
$this->name = $name;
}
function toString()
{
return $this->name;
}
}
I have some data as a text , with names age etc in lines, that am parsing. Am parsing data and i will put all data in a collection of Person objects and then later i plan to use some loop , to loop objects and for example calculate average height of person.
1. Is my model class ok ? I will add other attributes later.
2. When i create array and try to add objects do i need to cal load model for every object ?
$this->load->model('Person');
$this->Person->initialise("George");
3. Am i doing something stupid here, cos in Java i would do it like this
thx