Code Duplication    Length = 12-15 lines in 2 locations

src/Oro/Bundle/EntityBundle/Entity/Manager/Field/EntityFieldManager.php 1 location

@@ 133-144 (lines=12) @@
130
     *
131
     * @return bool|OwnershipMetadataInterface
132
     */
133
    protected function getMetadataConfig($entity)
134
    {
135
        if (is_object($entity)) {
136
            $entity = ClassUtils::getClass($entity);
137
        }
138
139
        $metadata = $this->ownershipMetadataProvider->getMetadata($entity);
140
141
        return $metadata->hasOwner()
142
            ? $metadata
143
            : false;
144
    }
145
146
    /**
147
     * @param $entity

src/Oro/Bundle/OrganizationBundle/Form/Extension/OwnerFormExtension.php 1 location

@@ 526-540 (lines=15) @@
523
     * @return bool|OwnershipMetadataInterface
524
     * @throws \LogicException
525
     */
526
    protected function getMetadata($entity)
527
    {
528
        if (is_object($entity)) {
529
            $entity = ClassUtils::getClass($entity);
530
        }
531
        if (!$this->doctrineHelper->isManageableEntity($entity)) {
532
            return false;
533
        }
534
535
        $metadata = $this->ownershipMetadataProvider->getMetadata($entity);
536
537
        return $metadata->hasOwner()
538
            ? $metadata
539
            : false;
540
    }
541
542
    /**
543
     * Get business units ids for current user for current access level