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

Hmm, "hydrate" is a term used in one of the other frameworks, not a CI term. It looks like the intent is to populate an object, and there is nothing wrong with that.

Your problem stems from the constructor declaration, with an array parameter but no default.
When you "load" a model, one of them is instantiated. With no parameters to the constructor. Oops.
$donnees is null, and your Hydrate method blows up.

I think you need a default, like public function __construct(array $donnees = null), and that you should not try to "hydrate" anything if the parameter passed is null.
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