Code Duplication    Length = 12-12 lines in 2 locations

eZ/Publish/Core/Repository/ContentService.php 2 locations

@@ 1696-1707 (lines=12) @@
1693
        );
1694
1695
        $returnArray = array();
1696
        foreach ($spiRelations as $spiRelation) {
1697
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1698
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1699
                continue;
1700
            }
1701
1702
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1703
                $spiRelation,
1704
                $sourceContentInfo,
1705
                $contentInfo
1706
            );
1707
        }
1708
1709
        return $returnArray;
1710
    }
@@ 1658-1669 (lines=12) @@
1655
1656
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1657
        $relations = array();
1658
        foreach ($spiRelations as $spiRelation) {
1659
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1660
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1661
                continue;
1662
            }
1663
1664
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1665
                $spiRelation,
1666
                $contentInfo,
1667
                $destinationContentInfo
1668
            );
1669
        }
1670
1671
        return $relations;
1672
    }