concrete/src/Page/Collection/Collection.php
public static function getByID($cID, $version = 'RECENT')
    {
        $db = Loader::db();
        $q = 'select Collections.cDateAdded, Collections.cDateModified, Collections.cID from Collections where cID = ?';
        $row = $db->getRow($q, [$cID]);

        $c = new self();
        $c->setPropertiesFromArray($row);

        if ($version != false) {
            // we don't do this on the front page
            $c->loadVersionObject($version);
        }

        return $c;
    }
public static function getByID($cID, $version = 'RECENT')
    {
        $db = Loader::db();
        $q = 'select Collections.cDateAdded, Collections.cDateModified, Collections.cID from Collections where cID = ?';
        $row = $db->getRow($q, [$cID]);

        $c = new self();
        $c->setPropertiesFromArray($row);

        if ($version != false) {
            // we don't do this on the front page
            $c->loadVersionObject($version);
        }

        return $c;
    }
public static function getByID ( $ cID , $ version = 'RECENT' ) { $ db = Loader :: db ( ) ; $ q = 'select Collections.cDateAdded, Collections.cDateModified, Collections.cID from Collections where cID = ?' ; $ row = $ db -> getRow ( $ q , [ $ cID ] ) ; $ c = new self ( ) ; $ c -> setPropertiesFromArray ( $ row ) ; if ( $ version != false ) { // we don't do this on the front page $ c -> loadVersionObject ( $ version ) ; } return $ c ; }
Get a collection by ID.

@param int $cID The collection ID
@param string|int|false $version the collection version ('RECENT' for the most recent version, 'ACTIVE' for the currently published version, 'SCHEDULED' for the currently scheduled version, a falsy value to not load the collection version, or an integer to retrieve a specific version ID)

@return \Concrete\Core\Page\Collection\Collection If the collection is not found, you'll get an empty Collection instance
Get a collection by ID .