concrete/src/Page/Collection/Collection.php
public function clearCollectionAttributes($retainAKIDs = [])
    {
        $db = Loader::db();
        if (count($retainAKIDs) > 0) {
            $cleanAKIDs = [];
            foreach ($retainAKIDs as $akID) {
                $cleanAKIDs[] = (int) $akID;
            }
            $akIDStr = implode(',', $cleanAKIDs);
            $v2 = [$this->getCollectionID(), $this->getVersionID()];
            $db->query(
                "delete from CollectionAttributeValues where cID = ? and cvID = ? and akID not in ({$akIDStr})",
                $v2
            );
        } else {
            $v2 = [$this->getCollectionID(), $this->getVersionID()];
            $db->query('delete from CollectionAttributeValues where cID = ? and cvID = ?', $v2);
        }
        $this->reindex();
    }
public function clearCollectionAttributes($retainAKIDs = [])
    {
        $db = Loader::db();
        if (count($retainAKIDs) > 0) {
            $cleanAKIDs = [];
            foreach ($retainAKIDs as $akID) {
                $cleanAKIDs[] = (int) $akID;
            }
            $akIDStr = implode(',', $cleanAKIDs);
            $v2 = [$this->getCollectionID(), $this->getVersionID()];
            $db->query(
                "delete from CollectionAttributeValues where cID = ? and cvID = ? and akID not in ({$akIDStr})",
                $v2
            );
        } else {
            $v2 = [$this->getCollectionID(), $this->getVersionID()];
            $db->query('delete from CollectionAttributeValues where cID = ? and cvID = ?', $v2);
        }
        $this->reindex();
    }
public function clearCollectionAttributes ( $ retainAKIDs = [ ] ) { $ db = Loader :: db ( ) ; if ( count ( $ retainAKIDs ) > 0 ) { $ cleanAKIDs = [ ] ; foreach ( $ retainAKIDs as $ akID ) { $ cleanAKIDs [ ] = ( int ) $ akID ; } $ akIDStr = implode ( ',' , $ cleanAKIDs ) ; $ v2 = [ $ this -> getCollectionID ( ) , $ this -> getVersionID ( ) ] ; $ db -> query ( "delete from CollectionAttributeValues where cID = ? and cvID = ? and akID not in ({$akIDStr})" , $ v2 ) ; } else { $ v2 = [ $ this -> getCollectionID ( ) , $ this -> getVersionID ( ) ] ; $ db -> query ( 'delete from CollectionAttributeValues where cID = ? and cvID = ?' , $ v2 ) ; } $ this -> reindex ( ) ; }
Delete the values of the attributes associated to the currently loaded collection version.

@param int[] $retainAKIDs a list of attribute key IDs to keep (their values won't be deleted)
Delete the values of the attributes associated to the currently loaded collection version .