[limb-svn] r6425 - in 3.x/trunk/limb/wact/src: . components/form
svn at limb-project.com
svn at limb-project.com
Tue Oct 16 12:13:48 MSD 2007
Author: serega
Date: 2007-10-16 12:13:48 +0400 (Tue, 16 Oct 2007)
New Revision: 6425
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6425
Modified:
3.x/trunk/limb/wact/src/WactTemplate.class.php
3.x/trunk/limb/wact/src/components/form/WactFormComponent.class.php
Log:
-- WactTemplate :: getValue() and setValue() now prefers ArrayAccess operations to get/set methods
Modified: 3.x/trunk/limb/wact/src/WactTemplate.class.php
===================================================================
--- 3.x/trunk/limb/wact/src/WactTemplate.class.php 2007-10-16 08:12:07 UTC (rev 6424)
+++ 3.x/trunk/limb/wact/src/WactTemplate.class.php 2007-10-16 08:13:48 UTC (rev 6425)
@@ -78,12 +78,12 @@
if(is_scalar($source) || is_null($source))
return null;
+ if((is_array($source) || $source instanceof ArrayAccess) && isset($source[$value]))
+ return $source[$value];
+
if (is_object($source) && method_exists($source, 'get'))
return $source->get($value);
- if((is_array($source) || $source instanceof ArrayAccess) && isset($source[$value]))
- return $source[$value];
-
return null;
}
@@ -92,14 +92,14 @@
if(is_scalar($source) || is_null($source))
return;
+ if((is_array($source) || $source instanceof ArrayAccess))
+ $source[$field] = $value;
+
if (is_object($source) && method_exists($source, 'set'))
{
$source->set($field, $value);
return;
}
-
- if((is_array($source) || $source instanceof ArrayAccess))
- $source[$field] = $value;
}
/**
Modified: 3.x/trunk/limb/wact/src/components/form/WactFormComponent.class.php
===================================================================
--- 3.x/trunk/limb/wact/src/components/form/WactFormComponent.class.php 2007-10-16 08:12:07 UTC (rev 6424)
+++ 3.x/trunk/limb/wact/src/components/form/WactFormComponent.class.php 2007-10-16 08:13:48 UTC (rev 6425)
@@ -26,6 +26,7 @@
function __construct($id)
{
parent :: __construct($id);
+
$this->datasource = array();
}
More information about the limb-svn
mailing list