concrete/src/Page/Page.php
protected function populatePage($cInfo, $where, $cvID)
    {
        $db = Database::connection();

        $q0 = 'select Pages.cID, Pages.pkgID, Pages.siteTreeID, Pages.cPointerID, Pages.cPointerExternalLink, Pages.cIsDraft, Pages.cIsActive, Pages.cIsSystemPage, Pages.cPointerExternalLinkNewWindow, Pages.cFilename, Pages.ptID, Collections.cDateAdded, Pages.cDisplayOrder, Collections.cDateModified, cInheritPermissionsFromCID, cInheritPermissionsFrom, cOverrideTemplatePermissions, cCheckedOutUID, cIsTemplate, uID, cPath, cParentID, cChildren, cCacheFullPageContent, cCacheFullPageContentOverrideLifetime, cCacheFullPageContentLifetimeCustom from Pages inner join Collections on Pages.cID = Collections.cID left join PagePaths on (Pages.cID = PagePaths.cID and PagePaths.ppIsCanonical = 1) ';
        //$q2 = "select cParentID, cPointerID, cPath, Pages.cID from Pages left join PagePaths on (Pages.cID = PagePaths.cID and PagePaths.ppIsCanonical = 1) ";

        $row = $db->fetchAssoc($q0 . $where, [$cInfo]);
        if ($row !== false && $row['cPointerID'] > 0) {
            $originalRow = $row;
            $row = $db->fetchAssoc($q0 . 'where Pages.cID = ?', [$row['cPointerID']]);
        } else {
            $originalRow = null;
        }

        if ($row !== false) {
            foreach ($row as $key => $value) {
                $this->{$key} = $value;
            }
            if ($originalRow !== null) {
                $this->cPointerID = $originalRow['cPointerID'];
                $this->cIsActive = $originalRow['cIsActive'];
                $this->cPointerOriginalID = $originalRow['cID'];
                $this->cPointerOriginalSiteTreeID = $originalRow['siteTreeID'];
                $this->cPath = $originalRow['cPath'];
                $this->cParentID = $originalRow['cParentID'];
                $this->cDisplayOrder = $originalRow['cDisplayOrder'];
            }
            $this->isMasterCollection = $row['cIsTemplate'];
            $this->loadError(false);
            if ($cvID != false) {
                $this->loadVersionObject($cvID);
            }
        } else {
            // there was no record of this particular collection in the database
            $this->loadError(COLLECTION_NOT_FOUND);
        }
    }
protected function populatePage($cInfo, $where, $cvID)
    {
        $db = Database::connection();

        $q0 = 'select Pages.cID, Pages.pkgID, Pages.siteTreeID, Pages.cPointerID, Pages.cPointerExternalLink, Pages.cIsDraft, Pages.cIsActive, Pages.cIsSystemPage, Pages.cPointerExternalLinkNewWindow, Pages.cFilename, Pages.ptID, Collections.cDateAdded, Pages.cDisplayOrder, Collections.cDateModified, cInheritPermissionsFromCID, cInheritPermissionsFrom, cOverrideTemplatePermissions, cCheckedOutUID, cIsTemplate, uID, cPath, cParentID, cChildren, cCacheFullPageContent, cCacheFullPageContentOverrideLifetime, cCacheFullPageContentLifetimeCustom from Pages inner join Collections on Pages.cID = Collections.cID left join PagePaths on (Pages.cID = PagePaths.cID and PagePaths.ppIsCanonical = 1) ';
        //$q2 = "select cParentID, cPointerID, cPath, Pages.cID from Pages left join PagePaths on (Pages.cID = PagePaths.cID and PagePaths.ppIsCanonical = 1) ";

        $row = $db->fetchAssoc($q0 . $where, [$cInfo]);
        if ($row !== false && $row['cPointerID'] > 0) {
            $originalRow = $row;
            $row = $db->fetchAssoc($q0 . 'where Pages.cID = ?', [$row['cPointerID']]);
        } else {
            $originalRow = null;
        }

        if ($row !== false) {
            foreach ($row as $key => $value) {
                $this->{$key} = $value;
            }
            if ($originalRow !== null) {
                $this->cPointerID = $originalRow['cPointerID'];
                $this->cIsActive = $originalRow['cIsActive'];
                $this->cPointerOriginalID = $originalRow['cID'];
                $this->cPointerOriginalSiteTreeID = $originalRow['siteTreeID'];
                $this->cPath = $originalRow['cPath'];
                $this->cParentID = $originalRow['cParentID'];
                $this->cDisplayOrder = $originalRow['cDisplayOrder'];
            }
            $this->isMasterCollection = $row['cIsTemplate'];
            $this->loadError(false);
            if ($cvID != false) {
                $this->loadVersionObject($cvID);
            }
        } else {
            // there was no record of this particular collection in the database
            $this->loadError(COLLECTION_NOT_FOUND);
        }
    }
protected function populatePage ( $ cInfo , $ where , $ cvID ) { $ db = Database :: connection ( ) ; $ q0 = 'select Pages.cID, Pages.pkgID, Pages.siteTreeID, Pages.cPointerID, Pages.cPointerExternalLink, Pages.cIsDraft, Pages.cIsActive, Pages.cIsSystemPage, Pages.cPointerExternalLinkNewWindow, Pages.cFilename, Pages.ptID, Collections.cDateAdded, Pages.cDisplayOrder, Collections.cDateModified, cInheritPermissionsFromCID, cInheritPermissionsFrom, cOverrideTemplatePermissions, cCheckedOutUID, cIsTemplate, uID, cPath, cParentID, cChildren, cCacheFullPageContent, cCacheFullPageContentOverrideLifetime, cCacheFullPageContentLifetimeCustom from Pages inner join Collections on Pages.cID = Collections.cID left join PagePaths on (Pages.cID = PagePaths.cID and PagePaths.ppIsCanonical = 1) ' ; //$q2 = "select cParentID, cPointerID, cPath, Pages.cID from Pages left join PagePaths on (Pages.cID = PagePaths.cID and PagePaths.ppIsCanonical = 1) "; $ row = $ db -> fetchAssoc ( $ q0 . $ where , [ $ cInfo ] ) ; if ( $ row !== false && $ row [ 'cPointerID' ] > 0 ) { $ originalRow = $ row ; $ row = $ db -> fetchAssoc ( $ q0 . 'where Pages.cID = ?' , [ $ row [ 'cPointerID' ] ] ) ; } else { $ originalRow = null ; } if ( $ row !== false ) { foreach ( $ row as $ key => $ value ) { $ this -> { $ key } = $ value ; } if ( $ originalRow !== null ) { $ this -> cPointerID = $ originalRow [ 'cPointerID' ] ; $ this -> cIsActive = $ originalRow [ 'cIsActive' ] ; $ this -> cPointerOriginalID = $ originalRow [ 'cID' ] ; $ this -> cPointerOriginalSiteTreeID = $ originalRow [ 'siteTreeID' ] ; $ this -> cPath = $ originalRow [ 'cPath' ] ; $ this -> cParentID = $ originalRow [ 'cParentID' ] ; $ this -> cDisplayOrder = $ originalRow [ 'cDisplayOrder' ] ; } $ this -> isMasterCollection = $ row [ 'cIsTemplate' ] ; $ this -> loadError ( false ) ; if ( $ cvID != false ) { $ this -> loadVersionObject ( $ cvID ) ; } } else { // there was no record of this particular collection in the database $ this -> loadError ( COLLECTION_NOT_FOUND ) ; } }
Read the data from the database.

@param mixed $cInfo The argument of the $where condition
@param string $where The SQL 'WHERE' part
@param string|int $cvID
Read the data from the database .