public function create()
    {
        if ($this->isRequestGet()) {
            try {
                $this->returnSuccess($this->getForm($this->getClassParameter())->getData());
            } catch (common_Exception $e) {
                $this->returnFailure($e);
            }
        } elseif ($this->isRequestPost()) {
            try {
                $this->processForm($this->getClassParameter());
            } catch (common_Exception $e) {
                $this->returnFailure($e);
            }
        } else {
            $this->returnFailure(new common_exception_MethodNotAllowed(__METHOD__ . ' only accepts GET or POST method'));
        }
    }
public function create()
    {
        if ($this->isRequestGet()) {
            try {
                $this->returnSuccess($this->getForm($this->getClassParameter())->getData());
            } catch (common_Exception $e) {
                $this->returnFailure($e);
            }
        } elseif ($this->isRequestPost()) {
            try {
                $this->processForm($this->getClassParameter());
            } catch (common_Exception $e) {
                $this->returnFailure($e);
            }
        } else {
            $this->returnFailure(new common_exception_MethodNotAllowed(__METHOD__ . ' only accepts GET or POST method'));
        }
    }
public function create ( ) { if ( $ this -> isRequestGet ( ) ) { try { $ this -> returnSuccess ( $ this -> getForm ( $ this -> getClassParameter ( ) ) -> getData ( ) ) ; } catch ( common_Exception $ e ) { $ this -> returnFailure ( $ e ) ; } } elseif ( $ this -> isRequestPost ( ) ) { try { $ this -> processForm ( $ this -> getClassParameter ( ) ) ; } catch ( common_Exception $ e ) { $ this -> returnFailure ( $ e ) ; } } else { $ this -> returnFailure ( new common_exception_MethodNotAllowed ( __METHOD__ . ' only accepts GET or POST method' ) ) ; } }
Create a resource for class found into http request parameters

If http method is GET, return the form data
If http method is POST, process form

The POST request has to follow this structure:
array (
'propertyUri' => 'value',
'propertyUri1' => 'value1',
'propertyUri2' => 'value2',
'propertyUri3' => array(
'value', 'value2',
)
)

@requiresRight classUri WRITE
Create a resource for class found into http request parameters