Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * action initializeCreate
- *
- */
- public function initializeCreateAction(){
- if($this->request->hasArgument('project')) {
- $project = $this->request->getArgument('project');
- $propertyMappingConfiguration = $this->arguments->getArgument('project')->getPropertyMappingConfiguration();
- $propertyMappingConfiguration->allowProperties('branch');
- if(!empty($project['branch'])) {
- $propertyMappingConfiguration->forProperty('branch')->allowAllProperties();
- $propertyMappingConfiguration->allowModificationForSubProperty('branch');
- foreach($project['branch'] as $branchIndex => $branchPropertyArray) {
- $propertyPath = 'branch.' . $branchIndex;
- $propertyMappingConfiguration->forProperty($propertyPath)->allowAllProperties();
- $propertyMappingConfiguration->allowCreationForSubProperty($propertyPath);
- $propertyMappingConfiguration->allowModificationForSubProperty($propertyPath);
- } // end foreach
- } // end if(!empty)
- $propertyMappingConfiguration->allowProperties('documents');
- if(!empty($project['documents'])) {
- $propertyMappingConfiguration->forProperty('documents')->allowAllProperties();
- $propertyMappingConfiguration->allowModificationForSubProperty('documents');
- foreach($project['documents'] as $documentIndex => $documentPropertyArray) {
- $propertyPath = 'documents.' . $documentIndex;
- $propertyMappingConfiguration->forProperty($propertyPath)->allowAllProperties();
- $propertyMappingConfiguration->allowCreationForSubProperty($propertyPath);
- $propertyMappingConfiguration->allowModificationForSubProperty($propertyPath);
- } // end foreach
- } // end if(!empty)
- } // end if(request->hasArgument)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement