Method:
checkExists()
Class:
COLLECTION
Method Call:
include_once("core/collection/COLLECTION.php");
$collection = new COLLECTION($this->db);
INT $creator->checkExists(STRING: $title, STRING: $shortTitle, STRING: $collectionType);
Description:
Prior to inserting or updating a collection, this method should be called to check whether the new collection already exists in the WKX_collection table. If it does not, FALSE is returned; if it does, the collection ID is returned ready for insertion into the WKX_resource_misc table. The match is case-insensitive. Because $collectionType is used in the match, it is quite feasible for two collections with the same $title (even the same $shortTitle) but with a different $collectionType to exist in the WKX_collection table. For valid collection types, see core/collection/COLLECTIONMAP.php.
Usage:
$collection = new COLLECTION($this->db); $id = $collection->checkExists("Journal of Useless Knowledge", FALSE, "journal");