public function testGetEntityAttributesLockedFields() { $data = ['entity_code' => ['attributes' => ['attribute_code' => ['attribute_data' => ['locked' => 'locked_field', 'code' => 'code_test']]]]]; $this->_model->merge($data); $result = $this->_model->getEntityAttributesLockedFields('entity_code'); $this->assertEquals(['attribute_code' => ['code_test']], $result); }
/** * Retrieve attributes locked fields to edit * * @param string $entityTypeCode * @return array */ public function getAttributeLockedFields($entityTypeCode) { if (!$entityTypeCode) { return []; } if (isset($this->_attributesLockedFields[$entityTypeCode])) { return $this->_attributesLockedFields[$entityTypeCode]; } $attributesLockedFields = $this->_attributeConfig->getEntityAttributesLockedFields($entityTypeCode); if (count($attributesLockedFields)) { $this->_attributesLockedFields[$entityTypeCode] = $attributesLockedFields; return $this->_attributesLockedFields[$entityTypeCode]; } return []; }