This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 
<?php
defined('C5_EXECUTE') or die("Access Denied.");
class Concrete5_Model_BlockPermissionKey extends PermissionKey {

    public function copyFromPageOrAreaToBlock() {
        $paID = $this->getPermissionAccessID();
        if ($paID) { 
            $db = Loader::db();
            $co = $this->permissionObject->getBlockCollectionObject();
            $arHandle = $this->permissionObject->getAreaHandle();
            $db->Replace('BlockPermissionAssignments', array(
                'cID' => $co->getCollectionID(), 
                'cvID' => $co->getVersionID(), 
                'bID' => $this->permissionObject->getBlockID(), 
                'pkID' => $this->getPermissionKeyID(),
                'paID' => $paID), array('cID', 'cvID', 'bID', 'paID', 'pkID'), true);               
        }
    }
        

}