Object constructors shouldn't require an id if passed a $oRow object. Gets rid of

objectGetInstanceFromRow() since we can pass the row into the constructor instead.
This commit is contained in:
Alexander Nicolaysen Sørnes
2007-06-10 18:51:33 +00:00
committed by WineHQ
parent d0022decd4
commit f7b24fab9a
14 changed files with 411 additions and 357 deletions

View File

@@ -59,7 +59,7 @@ class ObjectManager
function display_table($aClean)
{
$this->checkMethods(array("ObjectGetEntries", "ObjectGetHeader",
"ObjectGetInstanceFromRow", "ObjectOutputTableRow", "canEdit"));
"ObjectOutputTableRow", "canEdit"));
$oObject = new $this->sClass();
@@ -108,8 +108,7 @@ class ObjectManager
/* output each entry */
for($iCount = 0; $oRow = mysql_fetch_object($hResult); $iCount++)
{
$oObject = call_user_func(array($this->sClass,
"objectGetInstanceFromRow"), $oRow);
$oObject = new $this->sClass(null, $oRow);
/* arg1 = OM object, arg2 = CSS style, arg3 = text for edit link */
$oObject->objectOutputTableRow($this, ($iCount % 2) ? "color0" : "color1",
@@ -295,7 +294,7 @@ class ObjectManager
for($i = 0; $oRow = mysql_fetch_object($hResult); $i++)
{
$oCandidate = $oObject->objectGetInstanceFromRow($oRow);
$oCandidate = new $this->sClass(null, $oRow);
if($oCandidate->objectGetId() == $this->iId)
{
$i++;