Operation findOrganizationPage

Finds organizations page

@param string $organizationId Organization id (required)
@param string $pageId page id (required)
@return \KuntaAPI\Model\Page
@throws \KuntaAPI\ApiException on non-2xx response
333133
public function findOrganizationPage($organizationId, $pageId)
    {
        list($response) = $this->findOrganizationPageWithHttpInfo($organizationId, $pageId);
        return $response;
    }
952786
def organization_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/organizations/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
751356
public function resolvePageLayout($pageId, $themeId = null)
    {
        /** @var $site \PageBuilder\Entity\Site */
        /** @var $parent \PageBuilder\Entity\Page */
        /** @var $page \PageBuilder\Entity\Page */
        /** @var $templateObj \PageBuilder\Entity\Template */
        /** @var PageModel $pageModel */

        $layout    = [];
        $pageModel = $this->getServiceLocator()->get('pagebuilder\model\page');
        $page      = $pageModel->getMainPageById($pageId);

        if ($page['layout']) {
            return $page['layout'];
        } elseif ($page['parentId']) {
            $parentPage = $pageModel->getMainPageById($page['parentId']);
            if ($parentPage['layout']) {
                return $parentPage['layout'];
            }
        }

        if (is_object($page) and $templateObj = $page->getTemplate()) {
            if ($layout = $templateObj->getLayout()) {
                return $layout;
            }
        }

        //get the sites default template's layout
        if ($site = $this->getServiceLocator()->get('active\site')) {
            if ($templateObj = $site->getDefaultTemplate()) {
                return $templateObj->getLayout();
            }
        }

        return $layout;
    }
572218
public function findOrganizationTile($organizationId, $tileId)
    {
        list($response) = $this->findOrganizationTileWithHttpInfo($organizationId, $tileId);
        return $response;
    }
1135123
public function findOrganizationBanner($organizationId, $bannerId)
    {
        list($response) = $this->findOrganizationBannerWithHttpInfo($organizationId, $bannerId);
        return $response;
    }
1234715
public void addCorporateGroupId(final String organizationId, final String corporateGroupId) {
        final DbOrganization dbOrganization = getOrganization(organizationId);

        if(!dbOrganization.getCorporateGroupIdPrefixes().contains(corporateGroupId)){
            dbOrganization.getCorporateGroupIdPrefixes().add(corporateGroupId);
            repositoryHandler.store(dbOrganization);
        }

        repositoryHandler.addModulesOrganization(corporateGroupId, dbOrganization);
    }
671773
public function getSitePage(
        SiteEntity $site,
        $pageId
    ) {
        try {
            /** @var \Rcm\Entity\Page $page */
            $page = $this->findOneBy(
                [
                    'site' => $site,
                    'pageId' => $pageId
                ]
            );
        } catch (\Exception $e) {
            $page = null;
        }

        return $page;
    }
1113556
public function get($organizationId, array $parameters = [])
    {
        if (empty($organizationId)) {
            throw new ApiException("Organization ID is empty.");
        }

        return parent::rest_read($organizationId, $parameters);
    }
157802
public function getClosureByPageId($pageId)
    {
        return $queryBuilder = function (EntityRepository $er) use ($pageId) {
            $qb = $er->createQueryBuilder('p');
            $qb2 = $er->createQueryBuilder('p2');
            $qb->andWhere(
                $qb->expr()->in(
                    'p.locale',
                    $qb2->select('p2.locale')
                        ->where('p2.id = :id')->getDql()
                )
            );

            $qb->setParameter('id', $pageId);

            return $qb;
        };
    }
1323993
public void removeCorporateGroupId(final String organizationId, final String corporateGroupId) {
        final DbOrganization dbOrganization = getOrganization(organizationId);

        if(dbOrganization.getCorporateGroupIdPrefixes().contains(corporateGroupId)){
            dbOrganization.getCorporateGroupIdPrefixes().remove(corporateGroupId);
            repositoryHandler.store(dbOrganization);
        }

        repositoryHandler.removeModulesOrganization(corporateGroupId, dbOrganization);
    }
112522
public function findElementsByPageId($pageId)
    {
        $this->makeSelect();
        $this->sql .= ' and page_element.page_id = ? order by block_key, element_sort';
        $this->bindValues[] = $pageId;

        return $this->find();
    }
498426
public function getOrganizationUsers($orgId)
    {
        $response = $this->doRequest(
            self::RESOURCE_GET_ORGANIZATION_USERS,
            [
                'orgId' => $orgId
            ]
        );

        return OrganizationUsersList::fromStream($response);
    }
1147503
public function getMembership($userId, $organization = '')
    {
        $contents = $this
            ->call('GET', implode('/', [self::ORGANIZATION_RESOURCE, $this->getOrganizationName($organization), 'memberships', $userId]))
            ->getBody()
            ->getContents();

        return $this->getSingleMemberShipFromJsonResponse($contents);
    }
267998
public function findPages(Website $website, $pageIds, $isAdmin, $isAPI = false)
    {
        $queryBuilder = $this->createQueryBuilder('page');
        if ($isAPI) {
            $queryBuilder->select('
                page.id,
                page.visible,
                page.title,
                page.isSection,
                page.left,
                page.level,
                page.right,
                page.root,
                IDENTITY(page.parent)
                ');
        } else {
            $queryBuilder->select('page');
        }
        $queryBuilder->andWhere('page.website = :website')
            ->andWhere($queryBuilder->expr()->in('page.id', $pageIds))
            ->orderBy('page.root, page.left', 'ASC')
            ->setParameter('website', $website);
        if ($isAdmin === false) {
            $queryBuilder
                ->andWhere('page.visible = :visible')
                ->setParameter('visible', true);
        }

        return $queryBuilder->getQuery()->getResult();
    }
1267399
public function getAllSubpages($pageId)
    {
        $results = array();
        //Services
        $melisTree = $this->serviceLocator->get('MelisEngineTree');
        $pagePub   = $this->getServiceLocator()->get('MelisEngineTablePagePublished');
        $pageSave  = $this->getServiceLocator()->get('MelisEngineTablePageSaved');

        $pageSearchType = null;
        $pages = $melisTree->getPageChildren($pageId,2);
        
        
        if($pages)
        {
            $rpages = $pages->toArray();
            
            foreach ($rpages as $page)
            {
                $pageStat = $page['page_status'] ?? null;
                //if the page is published
                if($pageStat){
                    $pageData       = $pagePub->getEntryById($page['tree_page_id'])->current();
                    $pageSearchType = $pageData->page_search_type ?? null;
                }
                //if the page is unpublished
                else{
                    $pageData = $pageSave->getEntryById($page['tree_page_id'])->current();
                    //if the unpublishedData is not present in page_saved table
                    if(!$pageData){
                        //Get the pageData in page_published table
                        $pageData = $pagePub->getEntryById($page['tree_page_id'])->current();
                    }
                    $pageSearchType = $pageData->page_search_type ?? null;
                }

                $tmp = $this->formatPageInArray($page,$pageSearchType);
                $children = $this->getAllSubpages($page['tree_page_id'] ?? null);

                if (!empty($children))
                    $tmp['pages'] = $children;

                $results[] = $tmp;
            }
        }
        return $results;
    }
995937
public function getByOrganizationByPeriodAndByStatus($organizationId, $periodIds, $status, $databaseConnectionName = null)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    return $this->JournalVoucher->setConnection($databaseConnectionName)
      ->where('organization_id', '=', $organizationId)
      ->whereIn('period_id', $periodIds)
      ->where('status', '=', $status)
      ->get();
  }
1261549
public function deleteOrganizationSetting($organizationId, $settingId)
    {
        list($response) = $this->deleteOrganizationSettingWithHttpInfo($organizationId, $settingId);
        return $response;
    }