Completed
Branch 0.2.1 (e70612)
by Anton
09:15
created

Menuitem::processEntity()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 8
Ratio 100 %
Metric Value
dl 8
loc 8
rs 9.4286
cc 3
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace Modules\Entitizer\Handler {
4
5
	use Modules\Entitizer, Template;
6
7 View Code Duplication
	class Menuitem extends Entitizer\Utils\Handler {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
9
		use Entitizer\Common\Menuitem;
10
11
		# Handler configuration
12
13
		protected static $controller = 'Modules\Entitizer\Controller\Menuitem';
14
15
		protected static $link = '/admin/content/menuitems';
16
17
		protected static $naming = 'text', $naming_new = '';
18
19
		protected static $form_class = 'Modules\Entitizer\Form\Menuitem';
20
21
		protected static $message_success_save = 'MENUITEM_SUCCESS_SAVE';
22
23
		protected static $message_error_remove = 'MENUITEM_ERROR_REMOVE';
24
25
		protected static $view = 'Blocks\Entitizer\Menuitems\Main';
26
27
		# Add additional data for specific entity
28
29
		protected function processEntity(Template\Asset\Block $contents) {
30
31
			if ((0 === $this->parent->id) || ('' === $this->parent->link)) {
32
33
				$contents->block('parent')->block('browse')->disable();
34
35
			} else $contents->block('parent')->block('browse')->link = $this->parent->link;
36
		}
37
	}
38
}
39