Remove dependency on ORMTable from ORMRow
authorjeroendedauw <jeroendedauw@gmail.com>
Mon, 18 Feb 2013 19:43:03 +0000 (20:43 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 10 Apr 2013 08:04:16 +0000 (08:04 +0000)
commitece97c358424015777db3881d87aa33966d634bd
tree5bd8e51d33ebfc852c67bfb6a5c285c97566bb30
parent3c3ba5e03e406bbfe0ae7e13991d421512c63dec
Remove dependency on ORMTable from ORMRow

IORMRow implementing objects take a IORMTable object in their constructor.
The later is a hard to construct service object while the former ideally
should just be a simple wrapper around a database row. This means IORMRow
objects are tightly coupled with IORMTable objects, which makes them
inflexible and makes various things such as testing logic contained in
them needlessly difficult.

This commit gets rid of this nonsense by allowing for construction of
ORMRow objects without providing an ORMTable. All methods dependent on
the table field have been deprecated. Most of these methods have a new
alternative in ORMTable. For instance, saving an ORMRow can now be done
by passing an instance of ORMRow to the updateRow method of an ORMTable
instance, rather then calling save on the ORMRow instance.

Backwards compatibility has been retained except for the fields passed
in the constructor no longer undergoing magical unserialization if it
looks like this is needed. I do not expect this will affect any existing
code though.

Change-Id: I86368821fc2cd0729df5342b8572eb470c0f77a0
includes/db/IORMRow.php
includes/db/ORMRow.php
includes/db/ORMTable.php