This is confusing me and I cannot understand why it is not passing the value from an object to a local variable and any help would be appreciated.
This code is in a foreach loop:
$pass_this['FY_CY_Wireless__c'] = $r->fields>FY_CY_Wireless__c;
$pass_this['FY_CY_Total_Design__c'] = $r->fields>FY_CY_Total_Design__c;
and if I do a print_r of the two array's I get this:
$r:
[CreatedDate] => 2007-07-30T12:45:47.000Z
[CreatedById] => 00550000000wI2LAAU
[LastModifiedDate] => 2007-07-30T14:10:16.000Z
[LastModifiedById] => 00550000000wI2LAAU
[SystemModstamp] => 2007-07-30T14:10:16.000Z
[LastActivityDate] => SimpleXMLElement Object
(
)
[FY_CY_Wireless__c] => 200000.0
[FY_CY_Total_Design__c] => 400000.0
)
$pass_this:
[createdbyid] => 00550000000wI2LAAU
[lastmodifieddate] => 2007-07-30T14:10:16.000Z
[lastmodifiedbyid] => 00550000000wI2LAAU
[systemmodstamp] => 2007-07-30T14:10:16.000Z
[FY_CY_Wireless__c] =>
[FY_CY_Total_Design__c] =>
Why aren't the two numeric values being passed from $r to $pass_this?
Here is the whole loop:
I fixed it myself with the the (string) case (you can also use (float))
$pass_this['fy_cy_wireless__c'] = (string)$r->fields->FY_CY_Wireless__c;
$pass_this['fy_cy_total_design__c'] = (string)$r->fields->FY_CY_Total_Design__c;
Any help would be appreciated as always! I am sure it is just a simple mistake on my part
TIA
Mike