1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Petkopara\CrudGeneratorBundle\Configuration; |
4
|
|
|
|
5
|
|
|
use Petkopara\CrudGeneratorBundle\Command\CrudGeneratorCommand; |
6
|
|
|
|
7
|
|
|
class Configuration |
8
|
|
|
{ |
9
|
|
|
|
10
|
|
|
protected $baseTemplate = 'PetkoparaCrudGeneratorBundle::base.html.twig'; |
11
|
|
|
protected $bundleViews = false; |
12
|
|
|
protected $filterType = CrudGeneratorCommand::FILTER_TYPE_INPUT; |
13
|
|
|
protected $withoutBulk = false; |
14
|
|
|
protected $withoutShow = false; |
15
|
|
|
protected $withoutWrite = false; |
16
|
|
|
protected $withoutSorting = false; |
17
|
|
|
protected $withoutPageSize = false; |
18
|
|
|
protected $overwrite = false; |
19
|
|
|
protected $routePrefix = ''; |
20
|
|
|
protected $format = 'annotation'; |
21
|
|
|
|
22
|
6 |
|
public function getCrudActions() |
23
|
|
|
{ |
24
|
6 |
|
$actions = array('index'); |
25
|
6 |
|
if ($this->withoutWrite === false) { |
26
|
6 |
|
$actions = array_merge($actions, array('new', 'edit', 'delete')); |
27
|
|
|
|
28
|
6 |
|
if ($this->withoutBulk === false) { |
29
|
6 |
|
array_push($actions, 'bulk'); |
30
|
6 |
|
} |
31
|
6 |
|
} |
32
|
6 |
|
if ($this->withoutShow === false) { |
33
|
6 |
|
array_push($actions, 'show'); |
34
|
6 |
|
} |
35
|
6 |
|
return $actions; |
36
|
|
|
} |
37
|
|
|
|
38
|
6 |
|
public function getBaseTemplate() |
39
|
|
|
{ |
40
|
6 |
|
return $this->baseTemplate; |
41
|
|
|
} |
42
|
|
|
|
43
|
6 |
|
public function getBundleViews() |
44
|
|
|
{ |
45
|
6 |
|
return $this->bundleViews; |
46
|
|
|
} |
47
|
|
|
|
48
|
6 |
|
public function getFilterType() |
49
|
|
|
{ |
50
|
6 |
|
return $this->filterType; |
51
|
|
|
} |
52
|
|
|
|
53
|
16 |
|
public function setBaseTemplate($baseTemplate) |
54
|
|
|
{ |
55
|
16 |
|
$this->baseTemplate = $baseTemplate; |
56
|
16 |
|
return $this; |
57
|
|
|
} |
58
|
|
|
|
59
|
16 |
|
public function setBundleViews($bundleViews) |
60
|
|
|
{ |
61
|
16 |
|
$this->bundleViews = $bundleViews; |
62
|
16 |
|
return $this; |
63
|
|
|
} |
64
|
|
|
|
65
|
15 |
|
public function setFilterType($filterType) |
66
|
|
|
{ |
67
|
15 |
|
$this->filterType = $filterType; |
68
|
15 |
|
return $this; |
69
|
|
|
} |
70
|
|
|
|
71
|
6 |
|
public function getWithoutBulk() |
72
|
|
|
{ |
73
|
6 |
|
return $this->withoutBulk; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
public function getWithoutShow() |
77
|
|
|
{ |
78
|
|
|
return $this->withoutShow; |
79
|
|
|
} |
80
|
|
|
|
81
|
15 |
|
public function setWithoutBulk($withoutBulk) |
82
|
|
|
{ |
83
|
15 |
|
if ($this->withoutWrite) { |
84
|
2 |
|
$this->withoutBulk = true; |
85
|
2 |
|
} else { |
86
|
13 |
|
$this->withoutBulk = $withoutBulk; |
87
|
|
|
} |
88
|
15 |
|
return $this; |
89
|
|
|
} |
90
|
|
|
|
91
|
15 |
|
public function setWithoutShow($withoutShow) |
92
|
|
|
{ |
93
|
15 |
|
$this->withoutShow = $withoutShow; |
94
|
15 |
|
return $this; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
public function getWithoutWrite() |
98
|
|
|
{ |
99
|
|
|
return $this->withoutWrite; |
100
|
|
|
} |
101
|
|
|
|
102
|
6 |
|
public function getOverwrite() |
103
|
|
|
{ |
104
|
6 |
|
return $this->overwrite; |
105
|
|
|
} |
106
|
|
|
|
107
|
6 |
|
public function getRoutePrefix() |
108
|
|
|
{ |
109
|
6 |
|
return $this->routePrefix; |
110
|
|
|
} |
111
|
|
|
|
112
|
6 |
|
public function getFormat() |
113
|
|
|
{ |
114
|
6 |
|
return $this->format; |
115
|
|
|
} |
116
|
|
|
|
117
|
15 |
|
public function setWithoutWrite($withoutWrite) |
118
|
|
|
{ |
119
|
15 |
|
$this->withoutWrite = $withoutWrite; |
120
|
15 |
|
} |
121
|
|
|
|
122
|
18 |
|
public function setOverwrite($overwrite) |
123
|
|
|
{ |
124
|
18 |
|
$this->overwrite = $overwrite; |
125
|
18 |
|
} |
126
|
|
|
|
127
|
21 |
|
public function setRoutePrefix($routePrefix) |
128
|
|
|
{ |
129
|
21 |
|
$this->routePrefix = $routePrefix; |
130
|
21 |
|
} |
131
|
|
|
|
132
|
21 |
|
public function setFormat($format) |
133
|
|
|
{ |
134
|
21 |
|
$this->format = $format; |
135
|
21 |
|
} |
136
|
6 |
|
public function getWithoutSorting() |
137
|
|
|
{ |
138
|
6 |
|
return $this->withoutSorting; |
139
|
|
|
} |
140
|
|
|
|
141
|
15 |
|
public function setWithoutSorting($withoutSorting) |
142
|
|
|
{ |
143
|
15 |
|
$this->withoutSorting = $withoutSorting; |
144
|
15 |
|
return $this; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
|
148
|
6 |
|
public function getWithoutPageSize() |
149
|
|
|
{ |
150
|
6 |
|
return $this->withoutPageSize; |
151
|
|
|
} |
152
|
|
|
|
153
|
15 |
|
public function setWithoutPageSize($withoutPageSize) |
154
|
|
|
{ |
155
|
15 |
|
$this->withoutPageSize = $withoutPageSize; |
156
|
15 |
|
return $this; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
|
160
|
|
|
|
161
|
|
|
|
162
|
|
|
|
163
|
|
|
|
164
|
|
|
} |
165
|
|
|
|