public function isMainZone($content)
    {
        if ($content instanceof ContentSet) {
            $pages = $this->entityManager->getRepository('BackBee\ClassContent\ContentSet')->findPagesByContent($content);

            if (count($pages) > 0) {
                foreach($pages as $page) {
                    if ($page instanceof Page) {
                        if (false !== $index = $page->getContentSet()->indexOf($content, true)) {
                            $zone = $page->getLayout()->getZone($index);
                            if (is_a($zone, '\stdClass') && 1 === $zone->mainZone) {
                                return $page;
                            }
                        }
                    }
                }
            }
        }

        return null;
    }
public function isMainZone($content)
    {
        if ($content instanceof ContentSet) {
            $pages = $this->entityManager->getRepository('BackBee\ClassContent\ContentSet')->findPagesByContent($content);

            if (count($pages) > 0) {
                foreach($pages as $page) {
                    if ($page instanceof Page) {
                        if (false !== $index = $page->getContentSet()->indexOf($content, true)) {
                            $zone = $page->getLayout()->getZone($index);
                            if (is_a($zone, '\stdClass') && 1 === $zone->mainZone) {
                                return $page;
                            }
                        }
                    }
                }
            }
        }

        return null;
    }
public function isMainZone ( $ content ) { if ( $ content instanceof ContentSet ) { $ pages = $ this -> entityManager -> getRepository ( 'BackBee\ClassContent\ContentSet' ) -> findPagesByContent ( $ content ) ; if ( count ( $ pages ) > 0 ) { foreach ( $ pages as $ page ) { if ( $ page instanceof Page ) { if ( false !== $ index = $ page -> getContentSet ( ) -> indexOf ( $ content , true ) ) { $ zone = $ page -> getLayout ( ) -> getZone ( $ index ) ; if ( is_a ( $ zone , '\stdClass' ) && 1 === $ zone -> mainZone ) { return $ page ; } } } } } } return null ; }
Check if a contentset is a main zone on a page

@param  AbstractClassContent $content The content to be updated.
Check if a contentset is a main zone on a page