concrete/src/File/Set/Set.php
public static function createAndGetSet($fs_name, $fs_type, $fs_uid = false)
    {
        if ($fs_uid === false) {
            $u = new User();
            $fs_uid = $u->uID;
        }

        $db = Database::connection();
        $criteria = array($fs_name, $fs_type, $fs_uid);
        $fsID = $db->fetchColumn('SELECT fsID FROM FileSets WHERE fsName=? AND fsType=? AND uID=?', $criteria);
        if ($fsID > 0) {
            return static::getByID($fsID);
        } else {
            $fs = static::create($fs_name, 0, $fs_uid, $fs_type);

            return $fs;
        }
    }
public static function createAndGetSet($fs_name, $fs_type, $fs_uid = false)
    {
        if ($fs_uid === false) {
            $u = new User();
            $fs_uid = $u->uID;
        }

        $db = Database::connection();
        $criteria = array($fs_name, $fs_type, $fs_uid);
        $fsID = $db->fetchColumn('SELECT fsID FROM FileSets WHERE fsName=? AND fsType=? AND uID=?', $criteria);
        if ($fsID > 0) {
            return static::getByID($fsID);
        } else {
            $fs = static::create($fs_name, 0, $fs_uid, $fs_type);

            return $fs;
        }
    }
public static function createAndGetSet ( $ fs_name , $ fs_type , $ fs_uid = false ) { if ( $ fs_uid === false ) { $ u = new User ( ) ; $ fs_uid = $ u -> uID ; } $ db = Database :: connection ( ) ; $ criteria = array ( $ fs_name , $ fs_type , $ fs_uid ) ; $ fsID = $ db -> fetchColumn ( 'SELECT fsID FROM FileSets WHERE fsName=? AND fsType=? AND uID=?' , $ criteria ) ; if ( $ fsID > 0 ) { return static :: getByID ( $ fsID ) ; } else { $ fs = static :: create ( $ fs_name , 0 , $ fs_uid , $ fs_type ) ; return $ fs ; } }
Creats a new fileset if set doesn't exists.

If we find a multiple groups with the same properties,
we return an array containing each group

@param string $fs_name
@param int    $fs_type
@param int|bool    $fs_uid

@return mixed

Dev Note: This will create duplicate sets with the same name if a set exists owned by another user!!!
Creats a new fileset if set doesn t exists .