Prev | Current Page 312 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

.. K
}
A This model class implements our Metaweblog interface
B Instantiating the objects we will need for our editPost method. Note the full version of this class would do more here.
C Establishing the method parameters.
Docblocks are the key to getting methods working with Zend_XmlRpc_Server. We??™ll go into more detail in
this section but their key role is to to determine the method help text and method signatures. In our example
you can see they indicate the type, variable name and description of each parameter.
D The docblock return value is also a requirement.
E The parameters must match our interface and the docblocks above.
F Here we are doing some rudimentary security checks with a custom auth class and throwing an exception if they fail.
G Filtering the data is important for security as it is in most cases.
H The $struct array is used to build the data to be used in the update query.
I The post is updated
J As specified in the return value of the dockblock we return a boolean on success.
K The full version would be required to implement all methods in the interface.
After a simple authentication check using the username and password passed in the parameters this
editPost() method filters and formats an array from the received data and updates the database row that
corresponds with the provided id.


Pages:
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
agencja reklamowa poznań Powermed Paula Atherton hale Paula Abdul