Commit 11fc84b0 authored by onny's avatar onny

added db mapper

parent 47c5f63c
......@@ -6,6 +6,7 @@
*/
/** @var $this \OCP\Route\IRouter */
$this->create('radio_index', '/')
->actionInclude('radio/index.php');
......
<?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]);
}
}
......@@ -43,6 +43,15 @@ $(function(){
}
function get_station_ids(){
$.ajax({
method: "GET",
url: "http://127.0.0.1/index.php/apps/radio/stations",
dataType: 'json',
success: function(data) {
alert(data);
return true;
}
});
return ["89920","44707","91101","85755","45281","78011","91102"]
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment