add support to file extension on exports and exposers
This commit is contained in:
parent
3058014b49
commit
fc91167c6c
|
@ -9,6 +9,7 @@ namespace Tainacan\Exposers\Types;
|
|||
abstract class Type {
|
||||
|
||||
protected $mappers = true; // List of supported mapper, leave true for all
|
||||
protected $extension = 'tnc'; // extension sufix for multi operation system compatibility
|
||||
|
||||
/**
|
||||
* Change response after api callbacks
|
||||
|
@ -19,7 +20,14 @@ abstract class Type {
|
|||
*/
|
||||
public abstract function rest_request_after_callbacks( $response, $handler, $request );
|
||||
|
||||
/**
|
||||
* Return list of supported mappers for this type
|
||||
*/
|
||||
public function get_mappers() {
|
||||
return apply_filters('tainacan-exporser-type-mappers', $this->mappers, $this);
|
||||
}
|
||||
|
||||
public function get_extension() {
|
||||
return $this->extension;
|
||||
}
|
||||
}
|
|
@ -7,6 +7,13 @@ namespace Tainacan\Exposers\Types;
|
|||
*
|
||||
*/
|
||||
class Xml extends Type {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @see \Tainacan\Exposers\Types\Type::extension
|
||||
* @var string
|
||||
*/
|
||||
protected $extension = 'xml';
|
||||
|
||||
/**
|
||||
*
|
||||
* {@inheritDoc}
|
||||
|
|
Loading…
Reference in New Issue