-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathImage.php
More file actions
64 lines (54 loc) · 1.08 KB
/
Image.php
File metadata and controls
64 lines (54 loc) · 1.08 KB
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
<?php
namespace Algolia\SearchBundle\TestApp\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity
*/
class Image
{
/**
* @var int
*
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"searchable"})
*/
private $id;
/**
* @var string
*/
private $url;
public function __construct(array $attributes = [])
{
$this->id = isset($attributes['id']) ? $attributes['id'] : null;
$this->url = isset($attributes['url']) ? $attributes['url'] : '/wp-content/uploads/flamingo.jpg';
}
/**
* @Groups({"searchable"})
*/
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
}
public function getUrl()
{
return $this->url;
}
public function setUrl($url)
{
$this->url = $url;
}
/**
* @Groups({"searchableCustom"})
*/
public function getCustomVirtualProperty()
{
return 'here';
}
}