[eluser]akkumaru[/eluser]
,, i think we should try to think in a quite different way when using specific language,,,
in JAVA, the objects are the core of the application, this concept is so powerful and secure
in PHP, however the core is the algorithm behind the application, the functionality, i suppose. PHP does support the OOP, but that is not the main feature.
in JAVA each model/bean is 'alive', may be independent to one another,, but still, we have to write some 'logic' and 'functionality' on other JAVA models --e.g. to connect to the database and perform CRUD
in PHP CI, the array concept is so flexible, enough to act as a model/bean(in JAVA), while the logic and functionality may be implemented as the model(in CI) itself,,
what in my mind might be something like this:
Code:
class Person extends Model
{
//...constructor
function getPerson($id)
{
//..query from DB a person whose id = $id
//..return a person record (as an array or an object)
}
function insertPerson($data)
{
// .. $data is an array, validate each element
// .. perform insertion to DB
}
// .. other functionality
}