public function addCollectionAlias($c)
    {
        $db = Database::connection();
        // the passed collection is the parent collection
        $cParentID = $c->getCollectionID();

        $u = new User();
        $uID = $u->getUserID();

        $handle = $this->getCollectionHandle();
        $cDisplayOrder = $c->getNextSubPageDisplayOrder();

        $_cParentID = $c->getCollectionID();
        $q = 'select PagePaths.cPath from PagePaths where cID = ?';
        $v = array($_cParentID);
        if ($_cParentID > 1) {
            $q .=  ' and ppIsCanonical = ?';
            $v[] = 1;
        }
        $cPath = $db->fetchColumn($q, $v);

        $data = array(
            'handle' => $this->getCollectionHandle(),
            'name' => $this->getCollectionName(),
        );
        $cobj = parent::addCollection($data);
        $newCID = $cobj->getCollectionID();

        $v = array($newCID, $cParentID, $uID, $this->getCollectionID(), $cDisplayOrder);
        $q = "insert into Pages (cID, cParentID, uID, cPointerID, cDisplayOrder) values (?, ?, ?, ?, ?)";
        $r = $db->prepare($q);

        $r->execute($v);

        PageStatistics::incrementParents($newCID);

        $q2 = 'insert into PagePaths (cID, cPath, ppIsCanonical, ppGeneratedFromURLSlugs) values (?, ?, ?, ?)';
        $v2 = array($newCID, $cPath.'/'.$handle, 1, 1);
        $db->executeQuery($q2, $v2);

        return $newCID;
    }
public function addCollectionAlias($c)
    {
        $db = Database::connection();
        // the passed collection is the parent collection
        $cParentID = $c->getCollectionID();

        $u = new User();
        $uID = $u->getUserID();

        $handle = $this->getCollectionHandle();
        $cDisplayOrder = $c->getNextSubPageDisplayOrder();

        $_cParentID = $c->getCollectionID();
        $q = 'select PagePaths.cPath from PagePaths where cID = ?';
        $v = array($_cParentID);
        if ($_cParentID > 1) {
            $q .=  ' and ppIsCanonical = ?';
            $v[] = 1;
        }
        $cPath = $db->fetchColumn($q, $v);

        $data = array(
            'handle' => $this->getCollectionHandle(),
            'name' => $this->getCollectionName(),
        );
        $cobj = parent::addCollection($data);
        $newCID = $cobj->getCollectionID();

        $v = array($newCID, $cParentID, $uID, $this->getCollectionID(), $cDisplayOrder);
        $q = "insert into Pages (cID, cParentID, uID, cPointerID, cDisplayOrder) values (?, ?, ?, ?, ?)";
        $r = $db->prepare($q);

        $r->execute($v);

        PageStatistics::incrementParents($newCID);

        $q2 = 'insert into PagePaths (cID, cPath, ppIsCanonical, ppGeneratedFromURLSlugs) values (?, ?, ?, ?)';
        $v2 = array($newCID, $cPath.'/'.$handle, 1, 1);
        $db->executeQuery($q2, $v2);

        return $newCID;
    }
public function addCollectionAlias ( $ c ) { $ db = Database :: connection ( ) ; // the passed collection is the parent collection $ cParentID = $ c -> getCollectionID ( ) ; $ u = new User ( ) ; $ uID = $ u -> getUserID ( ) ; $ handle = $ this -> getCollectionHandle ( ) ; $ cDisplayOrder = $ c -> getNextSubPageDisplayOrder ( ) ; $ _cParentID = $ c -> getCollectionID ( ) ; $ q = 'select PagePaths.cPath from PagePaths where cID = ?' ; $ v = array ( $ _cParentID ) ; if ( $ _cParentID > 1 ) { $ q .= ' and ppIsCanonical = ?' ; $ v [ ] = 1 ; } $ cPath = $ db -> fetchColumn ( $ q , $ v ) ; $ data = array ( 'handle' => $ this -> getCollectionHandle ( ) , 'name' => $ this -> getCollectionName ( ) , ) ; $ cobj = parent :: addCollection ( $ data ) ; $ newCID = $ cobj -> getCollectionID ( ) ; $ v = array ( $ newCID , $ cParentID , $ uID , $ this -> getCollectionID ( ) , $ cDisplayOrder ) ; $ q = "insert into Pages (cID, cParentID, uID, cPointerID, cDisplayOrder) values (?, ?, ?, ?, ?)" ; $ r = $ db -> prepare ( $ q ) ; $ r -> execute ( $ v ) ; PageStatistics :: incrementParents ( $ newCID ) ; $ q2 = 'insert into PagePaths (cID, cPath, ppIsCanonical, ppGeneratedFromURLSlugs) values (?, ?, ?, ?)' ; $ v2 = array ( $ newCID , $ cPath . '/' . $ handle , 1 , 1 ) ; $ db -> executeQuery ( $ q2 , $ v2 ) ; return $ newCID ; }
Make an alias to a page.

@param Collection $c

@return int $newCID
Make an alias to a page .