@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | ) { |
| 77 | 77 | parent::__construct($application, $filesystem); |
| 78 | 78 | $this->setName('make:crud') |
| 79 | - ->setDescription('Command to generate platine CRUD action'); |
|
| 79 | + ->setDescription('Command to generate platine CRUD action'); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | $this->recordResourceClasses(); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - /** |
|
| 96 | - * {@inheritdoc} |
|
| 97 | - */ |
|
| 95 | + /** |
|
| 96 | + * {@inheritdoc} |
|
| 97 | + */ |
|
| 98 | 98 | public function getClassTemplate(): string |
| 99 | 99 | { |
| 100 | 100 | return <<<EOF |
@@ -71,45 +71,45 @@ discard block |
||
| 71 | 71 | class CrudAction |
| 72 | 72 | { |
| 73 | 73 | /** |
| 74 | - * The Lang instance |
|
| 75 | - * @var Lang |
|
| 76 | - */ |
|
| 74 | + * The Lang instance |
|
| 75 | + * @var Lang |
|
| 76 | + */ |
|
| 77 | 77 | protected Lang $lang; |
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | - * The Pagination instance |
|
| 81 | - * @var Pagination |
|
| 82 | - */ |
|
| 80 | + * The Pagination instance |
|
| 81 | + * @var Pagination |
|
| 82 | + */ |
|
| 83 | 83 | protected Pagination $pagination; |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * The Template instance |
|
| 87 | - * @var Template |
|
| 88 | - */ |
|
| 86 | + * The Template instance |
|
| 87 | + * @var Template |
|
| 88 | + */ |
|
| 89 | 89 | protected Template $template; |
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | - * The Flash instance |
|
| 93 | - * @var Flash |
|
| 94 | - */ |
|
| 92 | + * The Flash instance |
|
| 93 | + * @var Flash |
|
| 94 | + */ |
|
| 95 | 95 | protected Flash $flash; |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * The RouteHelper instance |
|
| 99 | - * @var RouteHelper |
|
| 100 | - */ |
|
| 98 | + * The RouteHelper instance |
|
| 99 | + * @var RouteHelper |
|
| 100 | + */ |
|
| 101 | 101 | protected RouteHelper $routeHelper; |
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | - * The LoggerInterface instance |
|
| 105 | - * @var LoggerInterface |
|
| 106 | - */ |
|
| 104 | + * The LoggerInterface instance |
|
| 105 | + * @var LoggerInterface |
|
| 106 | + */ |
|
| 107 | 107 | protected LoggerInterface $logger; |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | - * The Repository instance |
|
| 111 | - * @var Repository<TEntity> |
|
| 112 | - */ |
|
| 110 | + * The Repository instance |
|
| 111 | + * @var Repository<TEntity> |
|
| 112 | + */ |
|
| 113 | 113 | protected Repository $repository; |
| 114 | 114 | |
| 115 | 115 | /** |
@@ -197,14 +197,14 @@ discard block |
||
| 197 | 197 | protected string $validatorClass; |
| 198 | 198 | |
| 199 | 199 | /** |
| 200 | - * Create new instance |
|
| 201 | - * @param Lang $lang |
|
| 202 | - * @param Pagination $pagination |
|
| 203 | - * @param Template $template |
|
| 204 | - * @param Flash $flash |
|
| 205 | - * @param RouteHelper $routeHelper |
|
| 206 | - * @param LoggerInterface $logger |
|
| 207 | - */ |
|
| 200 | + * Create new instance |
|
| 201 | + * @param Lang $lang |
|
| 202 | + * @param Pagination $pagination |
|
| 203 | + * @param Template $template |
|
| 204 | + * @param Flash $flash |
|
| 205 | + * @param RouteHelper $routeHelper |
|
| 206 | + * @param LoggerInterface $logger |
|
| 207 | + */ |
|
| 208 | 208 | public function __construct( |
| 209 | 209 | Lang $lang, |
| 210 | 210 | Pagination $pagination, |
@@ -222,10 +222,10 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
| 225 | - * List all entities |
|
| 226 | - * @param ServerRequestInterface $request |
|
| 227 | - * @return ResponseInterface |
|
| 228 | - */ |
|
| 225 | + * List all entities |
|
| 226 | + * @param ServerRequestInterface $request |
|
| 227 | + * @return ResponseInterface |
|
| 228 | + */ |
|
| 229 | 229 | public function index(ServerRequestInterface $request): ResponseInterface |
| 230 | 230 | { |
| 231 | 231 | $context = $this->getTemplateData(); |
@@ -237,14 +237,14 @@ discard block |
||
| 237 | 237 | $currentPage = (int) $param->get('page', 1); |
| 238 | 238 | |
| 239 | 239 | $this->pagination->setTotalItems($totalItems) |
| 240 | - ->setCurrentPage($currentPage); |
|
| 240 | + ->setCurrentPage($currentPage); |
|
| 241 | 241 | |
| 242 | 242 | $limit = $this->pagination->getItemsPerPage(); |
| 243 | 243 | $offset = $this->pagination->getOffset(); |
| 244 | 244 | |
| 245 | 245 | $query = $this->repository->query(); |
| 246 | 246 | $query->offset($offset) |
| 247 | - ->limit($limit); |
|
| 247 | + ->limit($limit); |
|
| 248 | 248 | |
| 249 | 249 | if (count($this->orderFields) > 0) { |
| 250 | 250 | foreach ($this->orderFields as $field => $dir) { |
@@ -270,10 +270,10 @@ discard block |
||
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | /** |
| 273 | - * List entity detail |
|
| 274 | - * @param ServerRequestInterface $request |
|
| 275 | - * @return ResponseInterface |
|
| 276 | - */ |
|
| 273 | + * List entity detail |
|
| 274 | + * @param ServerRequestInterface $request |
|
| 275 | + * @return ResponseInterface |
|
| 276 | + */ |
|
| 277 | 277 | public function detail(ServerRequestInterface $request): ResponseInterface |
| 278 | 278 | { |
| 279 | 279 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -301,10 +301,10 @@ discard block |
||
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
| 304 | - * Create new entity |
|
| 305 | - * @param ServerRequestInterface $request |
|
| 306 | - * @return ResponseInterface |
|
| 307 | - */ |
|
| 304 | + * Create new entity |
|
| 305 | + * @param ServerRequestInterface $request |
|
| 306 | + * @return ResponseInterface |
|
| 307 | + */ |
|
| 308 | 308 | public function create(ServerRequestInterface $request): ResponseInterface |
| 309 | 309 | { |
| 310 | 310 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -378,10 +378,10 @@ discard block |
||
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | /** |
| 381 | - * Update existing entity |
|
| 382 | - * @param ServerRequestInterface $request |
|
| 383 | - * @return ResponseInterface |
|
| 384 | - */ |
|
| 381 | + * Update existing entity |
|
| 382 | + * @param ServerRequestInterface $request |
|
| 383 | + * @return ResponseInterface |
|
| 384 | + */ |
|
| 385 | 385 | public function update(ServerRequestInterface $request): ResponseInterface |
| 386 | 386 | { |
| 387 | 387 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -467,10 +467,10 @@ discard block |
||
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /** |
| 470 | - * Delete the entity |
|
| 471 | - * @param ServerRequestInterface $request |
|
| 472 | - * @return ResponseInterface |
|
| 473 | - */ |
|
| 470 | + * Delete the entity |
|
| 471 | + * @param ServerRequestInterface $request |
|
| 472 | + * @return ResponseInterface |
|
| 473 | + */ |
|
| 474 | 474 | public function delete(ServerRequestInterface $request): ResponseInterface |
| 475 | 475 | { |
| 476 | 476 | $routeListName = sprintf('%s_list', $this->routePrefix); |