protected function isLoaded($table = null, $database = null)
    {
        //if no table
        if (is_null($table)) {
            //if no default table either
            if (!$this->table) {
                return false;
            }
            
            $table = $this->table;
        }
        
        //if no database
        if (is_null($database)) {
            //and no default database
            if (!$this->database) {
                return false;
            }
            
            $database = $this->database;
        }
        
        $meta = $this->getMeta($table, $database);
        
        return $this->isPrimarySet($meta[self::PRIMARY]);
    }