Eccube\Repository\PageLayoutRepository::get PHP Метод

get() публичный Метод

public get ( Eccube\Entity\Master\DeviceType $DeviceType, $pageId )
$DeviceType Eccube\Entity\Master\DeviceType
    public function get(DeviceType $DeviceType, $pageId)
    {
        $qb = $this->createQueryBuilder('p')->select('p, bp, b')->leftJoin('p.BlockPositions', 'bp', 'WITH', 'p.id = bp.page_id')->leftJoin('bp.Block', 'b')->andWhere('p.DeviceType = :DeviceType AND p.id = :pageId')->addOrderBy('bp.target_id', 'ASC')->addOrderBy('bp.block_row', 'ASC');
        $ownResult = $qb->getQuery()->setParameters(array('DeviceType' => $DeviceType, 'pageId' => $pageId))->getSingleResult();
        $qb = $this->createQueryBuilder('p')->select('p, bp, b')->leftJoin('p.BlockPositions', 'bp', 'WITH', 'p.id = bp.page_id')->leftJoin('bp.Block', 'b')->andWhere('p.DeviceType = :DeviceType AND bp.anywhere = 1')->addOrderBy('bp.target_id', 'ASC')->addOrderBy('bp.block_row', 'ASC');
        $anyResults = $qb->getQuery()->setParameters(array('DeviceType' => $DeviceType))->getResult();
        $OwnBlockPosition = $ownResult->getBlockPositions();
        foreach ($anyResults as $anyResult) {
            $BlockPositions = $anyResult->getBlockPositions();
            foreach ($BlockPositions as $BlockPosition) {
                if (!$OwnBlockPosition->contains($BlockPosition)) {
                    $ownResult->addBlockPosition($BlockPosition);
                }
            }
        }
        return $ownResult;
    }