mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-05 16:17:28 +02:00
[FormatInterface] Implement functions in the template
@@ -91,6 +91,10 @@ This is a bare minimum template for a format:
|
||||
```PHP
|
||||
<?php
|
||||
class MyTypeFormat implements FormatInterface {
|
||||
private $items;
|
||||
private $charset;
|
||||
private $extraInfos;
|
||||
|
||||
public function stringify(){
|
||||
// Implement your code here
|
||||
return ''; // Return items as string
|
||||
@@ -103,33 +107,30 @@ class MyTypeFormat implements FormatInterface {
|
||||
}
|
||||
|
||||
public function setItems(array $items){
|
||||
// Implement your code here!
|
||||
$this->items = $items;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getItems(){
|
||||
// Implement your code here!
|
||||
return array(); // Return original items
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
public function setCharset($charset){
|
||||
// Implement your code here!
|
||||
$this->charset = $charset;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCharset(){
|
||||
// Implement your code here!
|
||||
return ''; // Return the charset!
|
||||
return $this->charset;
|
||||
}
|
||||
|
||||
public function setExtraInfos(array $infos){
|
||||
// Implement your code here!
|
||||
$this->extraInfos = $infos;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getExtraInfos(){
|
||||
// Implement your code here!
|
||||
return array(); // Return the original infos!
|
||||
return $this->extraInfos;
|
||||
}
|
||||
}
|
||||
// Imaginary empty line!
|
||||
|
Reference in New Issue
Block a user