public function createOne(\Psr\Http\Message\ServerRequestInterface $p_request)
    {
        $this->logger->debug('FreeFW.ApiController.createOne.start');
        $apiParams = $p_request->getAttribute('api_params', false);
        //
        if ($apiParams->hasData()) {
            /**
             * @var \FreeFW\Core\StorageModel $data
             */
            $data = $apiParams->getData();
            if (!$data->isValid()) {
                $this->logger->debug('FreeFW.ApiController.createOne.end');
                return $this->createResponse(409, $data);
            }
            $data->create();
            $this->logger->debug('FreeFW.ApiController.createOne.end');
            return $this->createResponse(201, $data);
        } else {
            return $this->createResponse(409);
        }
    }
public function createOne(\Psr\Http\Message\ServerRequestInterface $p_request)
    {
        $this->logger->debug('FreeFW.ApiController.createOne.start');
        $apiParams = $p_request->getAttribute('api_params', false);
        //
        if ($apiParams->hasData()) {
            /**
             * @var \FreeFW\Core\StorageModel $data
             */
            $data = $apiParams->getData();
            if (!$data->isValid()) {
                $this->logger->debug('FreeFW.ApiController.createOne.end');
                return $this->createResponse(409, $data);
            }
            $data->create();
            $this->logger->debug('FreeFW.ApiController.createOne.end');
            return $this->createResponse(201, $data);
        } else {
            return $this->createResponse(409);
        }
    }
public function createOne ( \ Psr \ Http \ Message \ ServerRequestInterface $ p_request ) { $ this -> logger -> debug ( 'FreeFW.ApiController.createOne.start' ) ; $ apiParams = $ p_request -> getAttribute ( 'api_params' , false ) ; // if ( $ apiParams -> hasData ( ) ) { /**
             * @var \FreeFW\Core\StorageModel $data
             */ $ data = $ apiParams -> getData ( ) ; if ( ! $ data -> isValid ( ) ) { $ this -> logger -> debug ( 'FreeFW.ApiController.createOne.end' ) ; return $ this -> createResponse ( 409 , $ data ) ; } $ data -> create ( ) ; $ this -> logger -> debug ( 'FreeFW.ApiController.createOne.end' ) ; return $ this -> createResponse ( 201 , $ data ) ; } else { return $ this -> createResponse ( 409 ) ; } }
Add new single element

@param \Psr\Http\Message\ServerRequestInterface $p_request
Add new single element