/** * @param EntityMetadata $entityMetadata * * @return bool */ protected function isApplicableNoteActivity(EntityMetadata $entityMetadata) { if ($this->activityListChainProvider->isApplicableTarget($entityMetadata->getClassName(), Note::ENTITY_NAME)) { return true; } return false; }
public function testIsApplicableTargetForNotConfigurableTargetEntity() { $targetClassName = 'Test\\NotConfigurableTargetEntity'; $activityClassName = TestActivityProvider::ACTIVITY_CLASS_NAME; $this->configManager->expects($this->any())->method('hasConfig')->with($targetClassName)->willReturn(false); $this->configManager->expects($this->never())->method('getId'); $this->assertFalse($this->provider->isApplicableTarget($targetClassName, $activityClassName)); }
/** * Checks whether the activity list has at least one accessible activity type * * @param string $entityClass * * @return bool */ protected function hasApplicableActivityAssociations($entityClass) { $supportedActivities = $this->activityListProvider->getSupportedActivities(); foreach ($supportedActivities as $supportedActivity) { if ($this->activityListProvider->isApplicableTarget($entityClass, $supportedActivity)) { return true; } } return false; }