Ejemplo n.º 1
0
 /**
  * Checks if the entity can has notes
  *
  * @param object $entity
  * @return bool
  */
 public function isNoteAssociationEnabled($entity)
 {
     if (!is_object($entity) || !$this->doctrineHelper->isManageableEntity($entity) || $this->doctrineHelper->isNewEntity($entity)) {
         return false;
     }
     return $this->noteAssociationHelper->isNoteAssociationEnabled(ClassUtils::getClass($entity));
 }
Ejemplo n.º 2
0
 public function testIsNoteAssociationEnabledForEnabledButNotAccessibleAssociationButWithAccessibleFalse()
 {
     $entityClass = 'Test\\Entity';
     $config = new Config(new EntityConfigId('note', $entityClass));
     $config->set('enabled', true);
     $this->configManager->expects($this->once())->method('hasConfig')->with($entityClass)->willReturn(true);
     $this->configManager->expects($this->once())->method('getEntityConfig')->with('note', $entityClass)->willReturn($config);
     $this->configManager->expects($this->never())->method('getFieldConfig');
     $this->assertTrue($this->noteAssociationHelper->isNoteAssociationEnabled($entityClass, false));
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function isApplicableTarget($entityClass, $accessible = true)
 {
     return $this->noteAssociationHelper->isNoteAssociationEnabled($entityClass, $accessible);
 }