jwaterworth / php-dynamics-crm-2011

Automatically exported from code.google.com/p/php-dynamics-crm-2011
0 stars 0 forks source link

Return Strongly-Typed values from a Retrieve call #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, using the "retrieve" method returns a stdClass Object with 
properties for the Attributes of the Entity.

Instead, the retrieve method should generate a DynamicsCRM2011_Entity object of 
the appropriate type, which can then be used directly in Update requests, and 
other tasks.

Original issue reported on code.google.com by N.M.Pr...@gmail.com on 16 Mar 2012 at 2:15

GoogleCodeExporter commented 9 years ago
Needs to be done

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 2:34

GoogleCodeExporter commented 9 years ago
Need to cache Entity definitions before doing this

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 4:28

GoogleCodeExporter commented 9 years ago

Original comment by N.M.Pr...@gmail.com on 19 Mar 2012 at 5:11

GoogleCodeExporter commented 9 years ago
I'll pick this one up today

Original comment by N.M.Pr...@gmail.com on 19 Mar 2012 at 5:21

GoogleCodeExporter commented 9 years ago
Research to do: How strongly typed do we need to go?

Easy solution: Everything gets returned as a DynamicsCRM2011_Entity with the 
appropriate entityLogicalName.

However, if we ever implement specific features on the Incident (e.g. Close 
etc.), we won't get that if it's just an Entity.
* Possible solution: Can you cast an Entity to an Incident even if it wasn't 
originally created as one?  In this case, let the caller do the casting
* Possible solution: Use reflection to determine what Child classes exist, and 
find the one with the right entityLogicalName
* Possible solution: Assume that the class exists using the entityLogicalName 
in Titlecase, try and create it, if this fails, uses Entity
* Possible solution: As above, but somehow make it case insensitive

Original comment by N.M.Pr...@gmail.com on 19 Mar 2012 at 5:50

GoogleCodeExporter commented 9 years ago
Done and Tested

Original comment by N.M.Pr...@gmail.com on 20 Mar 2012 at 11:04