nextcloud-app-radio/db/stationmapper.php

24 lines
604 B
PHP
Raw Normal View History

2017-02-16 12:00:43 +00:00
<?php
namespace OCA\Radio\Db;
use OCP\IDb;
use OCP\AppFramework\Db\Mapper;
class StationMapper extends Mapper {
public function __construct(IDb $db) {
parent::__construct($db, 'radio_stations', '\OCA\Radio\Db\Station');
}
public function find($id, $userId) {
$sql = 'SELECT * FROM *PREFIX*ownnotes_notes WHERE id = ? AND user_id = ?';
return $this->findEntity($sql, [$id, $userId]);
}
public function findAll($userId) {
$sql = 'SELECT * FROM *PREFIX*ownnotes_notes WHERE user_id = ?';
return $this->findEntities($sql, [$userId]);
}
}