I have another question for the masses out there regarding trying to input values from a text input box to a custom class. I currently have a custom class named Company with properties that correspond to values in a MySQL database.
So I created an input UI on the client application that calls out for Address, Name, Zip, Phone, etc. – Then there is a button to submit to values to the database for creation. Here’s my question:
How do I take each individual textinput.text property and ‘mesh’ them all together to a Company object to send to the server? The PHP that is written takes in an argument like this:
public function createNewCompany (Company $item) { .......
So is that even the right way to send them in? Or???
There are a total of 11 things (properties) that need to be submitted.
As usual – any help is GREATLY appreciated.
Thank you in advance for your time and assistance!
-CS
Here’s an example I think you’ll find helpful :
http://wadearnold.com/blog/zend-amf-links
If you take a peek at that, it’s doing the exact type of stuff you’re trying to do, very clearly. I’ll summarize of the the basic parts for you…
What you need to do is transfer the input’s into a value object and send that object off to the server.
A value object is just an object you create that holds values (great name, eh?) You map this to an object of similar properties on the back end with the RemoteClass call:
On the server you have that same value object definition:
As for the transport, you’re going to use a RemoteObject which transports requests to your endpoint:
This maps to a method on your backend, in ContactDAO.php in this case :