On 17/09/15 20:51, Rowan Collins wrote:
>> exists($checklist) {
>> is_null($checklist) { create default/empty object(); }
>> else { create populate odbject($checklist);
>> } else {
>> display code in place of object;
>> }
>
> Thanks, this is an interesting example of how the function could be used.
I HAD hoped that someone would pick up that the current method does NOT
work cleanly! ;)
isset($checklist) {
Display $checklist
} else {
is_null($checklist) {
// pigging warning if $checklist does not exist!
displays without a setting ... so needs a value adding
} else {
display details why $checklist does not need setting
}
}
> To paraphrase, your 3 states being communicated from the controller to
> the view are:
> a) Do not use this object, even if you want to.
EG Vehicle is not old enough to need MOT
> b) If you want this object, you may create a default one.
EG No current MOT found
> c) If you want this object, create it with these parameters.
EG Display date of MOT ... when next one due should not be stored here,
only when one is added.
> You then want to use null for case (b), so need a "very null" value
> (non-existent variable) for case (a).
Database takes care of managing the business logic to ensure data is
consistent. One could use an invalid date for 'NULL' but these are not
consistent between database engines ... NULL is. Reading CAR data does
not return an 'MOT' record while it is not needed. 'MOT' does not exist
flags logic to display 'first MOT due' from registration date. Putting a
date in the 'MOT' field is not the way to handle that.
The business logic in decent databases like Oracle and Firebird rely on
NULL for many reasons, and while one can return more fields to handle
the 'three state' model, NOT returning a field is faster. MOT is crude
example, on council systems several sets of data may interact, and the
NULL state is significant.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
>> exists($checklist) {
>> is_null($checklist) { create default/empty object(); }
>> else { create populate odbject($checklist);
>> } else {
>> display code in place of object;
>> }
>
> Thanks, this is an interesting example of how the function could be used.
I HAD hoped that someone would pick up that the current method does NOT
work cleanly! ;)
isset($checklist) {
Display $checklist
} else {
is_null($checklist) {
// pigging warning if $checklist does not exist!
displays without a setting ... so needs a value adding
} else {
display details why $checklist does not need setting
}
}
> To paraphrase, your 3 states being communicated from the controller to
> the view are:
> a) Do not use this object, even if you want to.
EG Vehicle is not old enough to need MOT
> b) If you want this object, you may create a default one.
EG No current MOT found
> c) If you want this object, create it with these parameters.
EG Display date of MOT ... when next one due should not be stored here,
only when one is added.
> You then want to use null for case (b), so need a "very null" value
> (non-existent variable) for case (a).
Database takes care of managing the business logic to ensure data is
consistent. One could use an invalid date for 'NULL' but these are not
consistent between database engines ... NULL is. Reading CAR data does
not return an 'MOT' record while it is not needed. 'MOT' does not exist
flags logic to display 'first MOT due' from registration date. Putting a
date in the 'MOT' field is not the way to handle that.
The business logic in decent databases like Oracle and Firebird rely on
NULL for many reasons, and while one can return more fields to handle
the 'three state' model, NOT returning a field is faster. MOT is crude
example, on council systems several sets of data may interact, and the
NULL state is significant.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php