ee90de064583e0029fcf5649f129af7f2cb3868d
[rock.divinelegy.git] / DataAccess / DataMapper / IDataMapper.php
1 <?php
2
3 namespace DataAccess\DataMapper;
4
5 use Domain\Entities\IDivineEntity;
6
7 interface IDataMapper
8 {
9 //TODO: Table is the wrong name. We actually give the implementation the entity name and it finds the table from the maps.
10
11 //find in table based on criteria in queryString
12 public function find($entityName, $queryString);
13 //find id in table and return it as an entity
14 public function findById($id, $entityName);
15 //find rows with id >= id and stop at limit
16 public function findRange($id, $entityName, $limit);
17 //insert/update entity in table
18 public function save(IDivineEntity $entity);
19 //remove entity from table
20 public function remove(IDivineEntity $entity);
21 }