本文整理汇总了PHP中Oro\Bundle\EntityBundle\ORM\DoctrineHelper::isManageableEntityClass方法的典型用法代码示例。如果您正苦于以下问题:PHP DoctrineHelper::isManageableEntityClass方法的具体用法?PHP DoctrineHelper::isManageableEntityClass怎么用?PHP DoctrineHelper::isManageableEntityClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oro\Bundle\EntityBundle\ORM\DoctrineHelper
的用法示例。
在下文中一共展示了DoctrineHelper::isManageableEntityClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* {@inheritdoc}
*/
public function process(ContextInterface $context)
{
/** @var ConfigContext $context */
/** @var array|null $definition */
$definition = $context->getResult();
if (empty($definition) || !is_array($definition[ConfigUtil::FIELDS])) {
// nothing to do
return;
}
$fieldsDefinition = $definition[ConfigUtil::FIELDS];
$entityClass = $context->getClassName();
if (!$this->doctrineHelper->isManageableEntityClass($entityClass)) {
return;
}
$filterFieldsConfig = $context->get(FilterFieldsConfigExtra::NAME);
$this->filterFields($entityClass, $fieldsDefinition, $filterFieldsConfig);
$this->filterAssociations($entityClass, $fieldsDefinition, $filterFieldsConfig);
$context->setResult([ConfigUtil::EXCLUSION_POLICY => ConfigUtil::EXCLUSION_POLICY_ALL, ConfigUtil::FIELDS => $fieldsDefinition]);
}
示例2: testIsManageableEntityClassForNotManageableEntity
public function testIsManageableEntityClassForNotManageableEntity()
{
$class = 'Oro\\Bundle\\EntityBundle\\Tests\\Unit\\ORM\\Stub\\ItemStub';
$this->registry->expects($this->once())->method('getManagerForClass')->with($class)->will($this->returnValue(null));
$this->assertFalse($this->doctrineHelper->isManageableEntityClass($class));
}