| 1 | <?php |
||
| 8 | abstract class AbstractBackend implements IBackend { |
||
| 9 | |||
| 10 | protected static $initConvs = array(); |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var \OCP\IConfig |
||
| 14 | */ |
||
| 15 | private $config; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var \OCA\Chat\Db\ConfigMapper |
||
| 19 | */ |
||
| 20 | private $configMapper; |
||
| 21 | |||
| 22 | public function __construct(ConfigMapper $configMapper, IConfig $config){ |
||
| 26 | |||
| 27 | public function hasProtocol($protocol){ |
||
| 28 | if(in_array($protocol, $this->getProtocols())){ |
||
| 29 | return true; |
||
| 30 | } else { |
||
| 31 | return false; |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | public function toArray(){ |
||
| 36 | $result = array(); |
||
| 37 | $result['id'] = $this->getId(); |
||
| 38 | $result['enabled'] = $this->isEnabled(); |
||
| 39 | $result['displayname'] = $this->getDisplayName(); |
||
| 40 | $result['protocols'] = $this->getProtocols(); |
||
| 41 | $result['config'] = $this->getConfig(); |
||
| 42 | $result['connected'] = false; |
||
| 43 | return $result; |
||
| 44 | } |
||
| 45 | |||
| 46 | public function isEnabled(){ |
||
| 49 | |||
| 50 | public function getConfig(){ |
||
| 51 | $config = $this->configMapper->getByBackend($this->getId()); |
||
| 60 | |||
| 61 | } |