本文整理匯總了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));
}