In the loosely based ActiveRecord system I am building it is possible to deselect columns. If this is done then those columns will not be selected or included as properties of the returned objects.

Take for example a simple scenario where a Project is found with a primary key of 8 while deselecting the summary field.

PHP Code:
$o Project::find('one',array('id'=>8,'limit'=>1,'deselect'=>'summary')); 
In this case a dump of the returned object properties reveals that a summary property does not exist.

HTML Code:
Project Object
(
    [_data:private] => ActiveRecordDataEntity Object
        (
            [_data:private] => Array
                (
                    [id] => Array
                        (
                            [0] => 8
                        )

                    [name] => Array
                        (
                            [0] => Site Name
                        )

                    [weight] => Array
                        (
                            [0] => 8
                        )

                    [web_site] => Array
                        (
                            [0] => http://www.site_name.com/
                        )

                    [created] => Array
                        (
                            [0] => 2009-04-16 11:59:11
                        )

                )

        )

)
This is not a problem until the object needs to be saved. When the object is saved only properties that have changed are updated. A changed property is defined by one which has a array count of more then one. Therefore, if the summary property is set on the previous object the summary in theory has not been changed.

PHP Code:
$o->summary 'Changed this summary'
A dump of the object will reveal that array pertaining to the summary object only has one value.

HTML Code:
Project Object
(
    [_data:private] => ActiveRecordDataEntity Object
        (
            [_data:private] => Array
                (
                    [id] => Array
                        (
                            [0] => 8
                        )

                    [name] => Array
                        (
                            [0] => Site Name
                        )

                    [weight] => Array
                        (
                            [0] => 8
                        )

                    [web_site] => Array
                        (
                            [0] => http://www.site_name.com/
                        )

                    [created] => Array
                        (
                            [0] => 2009-04-16 11:59:11
                        )

                    [summary] => Array
                        (
                            [0] => Changed this summary
                        )

                )

        )

)
Thus, the summary property has not been changed. Although, in theory it has been. So the only way to have a deselected field evaluate to being changed is to set it twice currently.

PHP Code:
$o->summary '';
$o->summary 'Changed this summary'
Now, a dump of the object will reveal that the summary property has changed.

HTML Code:
Project Object
(
    [_data:private] => ActiveRecordDataEntity Object
        (
            [_data:private] => Array
                (
                    [id] => Array
                        (
                            [0] => 8
                        )

                    [name] => Array
                        (
                            [0] => Site Name
                        )

                    [weight] => Array
                        (
                            [0] => 8
                        )

                    [web_site] => Array
                        (
                            [0] => http://www.site_name.com/
                        )

                    [created] => Array
                        (
                            [0] => 2009-04-16 11:59:11
                        )

                    [summary] => Array
                        (
                            [0] => Changed this summary
                            [1] => 
                        )

                )

        )

)
The summary array has more then one value so the system will deem that it has been changed and include it upon saving the object.

However, I rather have the system know that something has changed without this hack. I'm not really sure how to approach this though since the has changed methodology is based on the idea that there is more then one value in memory for a specific property.

Any ideas or recommendations appreciated.