/** * Parse one customergroupacl * * @param SimpleXMLElement $customerGroupAcl A customergroupacl * @param CustomerGroup $customerGroupModel CustomerGroup propel object for who the access have to be created * * @throws \Exception When an error is detected on xml file (customer group or acl don't exist) */ protected function parseCustomerGroupAcl(SimpleXMLElement $customerGroupAcl, CustomerGroup $customerGroupModel) { $acl = AclQuery::create()->findOneByCode($customerGroupAcl->getAttributeAsPhp('aclcode')); if (null === $customerGroupModel) { throw new \Exception($this->translator->trans("Error in %a file the customer group '%s' doesn't exist", ['%a' => $this->xmlFilePath, '%s' => $customerGroupModel->getCode()], CustomerGroupAcl::DOMAIN_MESSAGE)); } if (null === $acl) { throw new \Exception($this->translator->trans("Error in %a file the acl '%s' doesn't exist", ['%a' => $this->xmlFilePath, '%s' => $customerGroupAcl->getAttributeAsPhp('aclcode')], CustomerGroupAcl::DOMAIN_MESSAGE)); } $this->parseAccesses($customerGroupAcl->children(), $acl, $customerGroupModel); }