/** * @param WorkflowEntityAcl $acl * @return WorkflowDefinition */ public function addEntityAcl(WorkflowEntityAcl $acl) { $attributeStep = $acl->getAttributeStepKey(); if (!$this->hasEntityAclByAttributeStep($attributeStep)) { $acl->setDefinition($this)->setStep($this->getStepByName($acl->getStep()->getName())); $this->entityAcls->add($acl); } else { $this->getEntityAclByAttributeStep($attributeStep)->import($acl); } return $this; }
/** * @param WorkflowEntityAcl $acl * @return WorkflowEntityAcl */ public function import(WorkflowEntityAcl $acl) { $this->setAttribute($acl->getAttribute())->setStep($this->getDefinition()->getStepByName($acl->getStep()->getName()))->setEntityClass($acl->getEntityClass())->setUpdatable($acl->isUpdatable())->setDeletable($acl->isDeletable()); return $this; }