20.11.2014 Views

O Guia Definitivo do Yii 1.1

O Guia Definitivo do Yii 1.1

O Guia Definitivo do Yii 1.1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

class PostController extends CController<br />

{<br />

/**<br />

* @return Post[] a list of posts<br />

* @soap<br />

*/<br />

public function getPosts()<br />

{<br />

return Post::model()->findAll();<br />

}<br />

}<br />

class Post extends CActiveRecord<br />

{<br />

/**<br />

* @var integer post ID<br />

* @soap<br />

*/<br />

public $id;<br />

/**<br />

* @var string post title<br />

* @soap<br />

*/<br />

public $title;<br />

}<br />

public static function model($className=__CLASS__)<br />

{<br />

return parent::model($className);<br />

}<br />

Class Mapping<br />

In order to receive parameters of composite type from client, an application needs to<br />

declare the mapping from WSDL types to the corresponding PHP classes. This is <strong>do</strong>ne by<br />

configuring the classMap property of CWebServiceAction.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!