1 | <?php |
||
36 | abstract class AbstractAttributeSubject extends AbstractSubject implements AttributeSubjectInterface |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * The array with the available entity types. |
||
41 | * |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $entityTypes = array(); |
||
45 | |||
46 | /** |
||
47 | * Mappings for attribute code => CSV column header. |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $headerMappings = array(); |
||
52 | |||
53 | /** |
||
54 | * Intializes the previously loaded global data for exactly one bunch. |
||
55 | * |
||
56 | * @param string $serial The serial of the actual import |
||
57 | * |
||
58 | * @return void |
||
59 | * @see \Importer\Csv\Actions\ProductImportAction::prepare() |
||
60 | */ |
||
61 | public function setUp($serial) |
||
73 | |||
74 | /** |
||
75 | * Clean up the global data after importing the bunch. |
||
76 | * |
||
77 | * @param string $serial The serial of the actual import |
||
78 | * |
||
79 | * @return void |
||
80 | */ |
||
81 | public function tearDown($serial) |
||
95 | |||
96 | /** |
||
97 | * Return's the header mappings for the actual entity. |
||
98 | * |
||
99 | * @return array The header mappings |
||
100 | */ |
||
101 | public function getHeaderMappings() |
||
105 | |||
106 | /** |
||
107 | * Map's the passed attribute code to the attribute ID that has been created recently. |
||
108 | * |
||
109 | * @param string $attributeCode The attribute code that has to be mapped |
||
110 | * |
||
111 | * @return void |
||
112 | */ |
||
113 | public function addAttributeCodeIdMapping($attributeCode) |
||
117 | |||
118 | /** |
||
119 | * Queries whether or not the attribute with the passed code has already been processed. |
||
120 | * |
||
121 | * @param string $attributeCode The attribute code to check |
||
122 | * |
||
123 | * @return boolean TRUE if the path has been processed, else FALSE |
||
124 | */ |
||
125 | public function hasBeenProcessed($attributeCode) |
||
129 | |||
130 | /** |
||
131 | * Return's the entity type for the passed code. |
||
132 | * |
||
133 | * @param string $entityTypeCode The entity type code |
||
134 | * |
||
135 | * @return array The requested entity type |
||
136 | * @throws \Exception Is thrown, if the entity type with the passed code is not available |
||
137 | */ |
||
138 | public function getEntityType($entityTypeCode) |
||
156 | } |
||
157 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: