1<?php 2 3namespace FYKOS\dokuwiki\Extension\PluginNewsFeed\ORM; 4 5use FYKOS\dokuwiki\Extension\PluginNewsFeed\Model\ModelStream; 6use helper_plugin_sqlite; 7 8/** 9 * Class ServiceNews 10 * @author Michal Červeňák <miso@fykos.cz> 11 */ 12class ServiceStream extends AbstractService { 13 public function __construct(helper_plugin_sqlite $sqlite) { 14 parent::__construct($sqlite, 'stream', ModelStream::class); 15 } 16 17 public function findByName(string $name): ?ModelStream { 18 $res = $this->sqlite->query('SELECT * FROM ' . $this->table . ' WHERE name=?', $name); 19 return ($this->modelClassName)::createFromArray($this->sqlite, $res->fetch()); 20 } 21} 22