Skip to content

Instantly share code, notes, and snippets.

@kiall
Created August 22, 2011 20:49
Show Gist options
  • Save kiall/1163496 to your computer and use it in GitHub Desktop.
Save kiall/1163496 to your computer and use it in GitHub Desktop.
<?php defined('SYSPATH') or die('No direct script access.');
/**
*
* @package API
* @category Library
* @author Managed I.T.
* @copyright (c) 2011 Managed I.T.
* @license https://github.com/managedit/kohana-api/blob/master/LICENSE.md
*/
class Response_API extends Kohana_Response {
/**
* @var array Response Metadata
*/
protected $_metadata = NULL;
/**
* Gets or sets the metadata of the response
*
* @return mixed
*/
public function metadata($metadata = NULL)
{
if ($metadata === NULL)
return $this->_metadata;
$this->_metadata = $metadata;
return $this;
}
/**
* @var array Response Payload
*/
protected $_payload = NULL;
/**
* Gets or sets the payload of the response
*
* @return mixed
*/
public function payload($metadata = NULL)
{
if ($metadata === NULL)
return $this->_metadata;
$this->_metadata = $metadata;
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment