Moar work

This commit is contained in:
Julius Haertl
2016-08-15 11:29:11 +02:00
parent 0e7a71787f
commit c958f9b37c
25 changed files with 616 additions and 414 deletions

View File

@@ -51,7 +51,13 @@ class BoardMapper extends Mapper {
*/
public function findAll($userId, $limit=null, $offset=null) {
$sql = 'SELECT * FROM `*PREFIX*deck_boards` WHERE `owner` = ? ORDER BY `title`';
return $this->findEntities($sql, [$userId], $limit, $offset);
$entries = $this->findEntities($sql, [$userId], $limit, $offset);
/* @var Board $entry */
foreach ($entries as $entry) {
$acl = $this->aclMapper->findAll($entry->id);
$entry->setAcl($acl);
}
return $entries;
}
public function delete(\OCP\AppFramework\Db\Entity $entity) {

View File

@@ -14,7 +14,7 @@ class LabelMapper extends DeckMapper {
}
public function findAll($boardId, $limit=null, $offset=null) {
$sql = 'SELECT * FROM `*PREFIX*deck_labels` WHERE `board_id` = ?';
$sql = 'SELECT * FROM `*PREFIX*deck_labels` WHERE `board_id` = ? ORDER BY `id`';
return $this->findEntities($sql, [$boardId], $limit, $offset);
}