-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathServicePicture.php
71 lines (59 loc) · 1.48 KB
/
ServicePicture.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* Description of Picture
*
* @author machar
*/
namespace Picture;
class ServicePicture extends \Nette\Object implements IPicture {
/**
*
* @var mapper MapperPicture
*/
protected $mapper;
public function __construct(MapperPicture $mapper) {
$this->mapper = $mapper;
}
/**
*
* @param string $idPhoto
* @param integer $width
* @param integer $height
* @return object Picture
*/
public function get($idPhoto, $width = null, $height = null) {
return $this->mapper->get(new \MongoId($idPhoto), $width, $height);
}
/**
*
* @param type $haystack
* @param type $needle
* @return array \MongoId
*/
public function find($haystack, $needle, $desc = 1) {
return $this->mapper->find($haystack, $needle, $desc);
}
/**
*
* @param Picture $picture
* @param \Nette\ArrayHash $options - pro ulozeni dalsich parametru fotky ve formatu klic/hodnota
*/
public function save(Picture $picture, \Nette\ArrayHash $options = null) {
$this->mapper->save($picture, $options);
}
/**
*
* @param Picture $picture
*/
public function delete(Picture $picture) {
$this->mapper->delete(new MongoId($picture->getIdPicture()));
}
/**
*
* @param Picture $picture
*/
public function update(Picture $picture) {
$this->mapper->update(new MongoId($picture->getIdPicture()));
}
}
?>