Files
deck/db/deckmapper.php
Julius Haertl c0a9f010a8 Add more
2016-06-20 10:44:41 +02:00

32 lines
768 B
PHP

<?php
namespace OCA\Deck\Db;
use OCP\AppFramework\Db\Entity;
use OCP\AppFramework\Db\Mapper;
abstract class DeckMapper extends Mapper {
/**
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result
*/
public function find($id) {
$sql = 'SELECT * FROM `' . $this->tableName . '` ' . 'WHERE `id` = ?';
return $this->findEntity($sql, [$id]);
}
/**
* Add relational data to an Entity by calling the related Mapper
* @param $entities
* @param $entityType
* @param $property
* addRelation($cards, $labels, function($one, $many) {
* if($one->id == $many->cardId)
* }
*/
public function addRelation($entities, $entityType, $property) {
}
}