/** * {@inheritdoc} */ protected function isReadOnly($options) { /** @var EntityConfigId $configId */ $configId = $options['config_id']; $className = $configId->getClassName(); if (!empty($className) && $this->typeHelper->isDictionary($className) && !$this->typeHelper->isSupportActivityEnabled($className)) { return true; } return parent::isReadOnly($options); }
/** * @dataProvider isDictionaryProvider */ public function testIsDictionary($groups, $expected) { $className = 'Test\\Entity'; $config = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\Config\\Config')->disableOriginalConstructor()->getMock(); $config->expects($this->once())->method('get')->with('groups')->will($this->returnValue($groups)); $configProvider = $this->getConfigProviderMock(); $this->configManager->expects($this->once())->method('getProvider')->with('grouping')->will($this->returnValue($configProvider)); $configProvider->expects($this->once())->method('hasConfig')->with($className)->will($this->returnValue(true)); $configProvider->expects($this->once())->method('getConfig')->with($className)->will($this->returnValue($config)); $this->assertEquals($expected, $this->typeHelper->isDictionary($className)); }
/** * {@inheritdoc} */ protected function isReadOnly($options) { /** @var EntityConfigId $configId */ $configId = $options['config_id']; $className = $configId->getClassName(); if (!empty($className)) { if ($this->typeHelper->isAssociationOwningSideEntity($className, $options['association_class'])) { return true; } if ($this->typeHelper->isDictionary($className)) { return true; } } return parent::isReadOnly($options); }