As we talked with @bluesnowman yesterday, Leap is leaving PHP 5.2.x in branch 3.2/legacy and move on to PHP 5.3.x, so we can use really needed functionality.
I got rid of most call_user_func() and use static:: instead. There are things that couldn't be done without it.
I changed all self:: to static::, because it's the right way to make everything extendable. In few 3. places that self:: strategy actually was giving unexpected results.
I got rid of is_null($value) and now using $value === NULL instead, because it's just better performance (at least twice as fast or more).
I did replace is_field(), is_alias() and is_adaptor() with isset() in places where it didn't make sense, so I did gain a little performance.
In function as_array() there was no adaptors or aliases values included, so I added them.
I modified save() function and added create() and update() functions, so the issue #62 is now solved. I found it more useful to leave the main functionality in save() function and not to duplicate code in newly created ones.
In my previous pull request I did introduce ability to set the 'default' field value setting to NULL, because you may want the default value to be a NULL, but it wasn't actually added to the repository, so I did it again. The thing is that isset() returns FALSE, if the value is NULL, so now we are using array_key_exists().
One day spent. That's all for now. I hope you will like it. ;)
Next to come: model validation. I will probably talk more about this with @bluesnowman before pushing.
As we talked with @bluesnowman yesterday, Leap is leaving PHP 5.2.x in branch 3.2/legacy and move on to PHP 5.3.x, so we can use really needed functionality.
self::
tostatic::
, because it's the right way to make everything extendable. In few 3. places thatself::
strategy actually was giving unexpected results.is_null($value)
and now using$value === NULL
instead, because it's just better performance (at least twice as fast or more).is_field()
,is_alias()
andis_adaptor()
withisset()
in places where it didn't make sense, so I did gain a little performance.as_array()
there was no adaptors or aliases values included, so I added them.save()
function and addedcreate()
andupdate()
functions, so the issue #62 is now solved. I found it more useful to leave the main functionality insave()
function and not to duplicate code in newly created ones.isset()
returns FALSE, if the value is NULL, so now we are usingarray_key_exists()
.One day spent. That's all for now. I hope you will like it. ;)
Next to come: model validation. I will probably talk more about this with @bluesnowman before pushing.