public static function load(string $query, ?array $params=array(), $option=NULL) {
		
		$self = static::getInstance();
		
		$self->openConnection();
		
		$res = NULL;
		
		try {

			// prepare query
			$stat = $self->handler->prepare($query);
			
			// bind parameters
			$stat->execute((array)$params);

			switch (strtolower($option)) {
				
				// list of stdClass objects
				default:
				case PAIR_DB_OBJECT_LIST:
				case 'objectlist':
					$res = $stat->fetchAll(\PDO::FETCH_OBJ);
					$count = count($res);
					break;
				
				// first row as stdClass object
				case PAIR_DB_OBJECT:
				case 'object':
					$res = $stat->fetch(\PDO::FETCH_OBJ);
					$count = (bool)$res;
					break;

				// array of first column results
				case PAIR_DB_RESULT_LIST:
				case 'resultlist':
					$res = $stat->fetchAll(\PDO::FETCH_COLUMN);
					$count = count($res);
					break;
			
				// first column of first row
				case PAIR_DB_RESULT:
				case 'result':
					$res = $stat->fetch(\PDO::FETCH_COLUMN);
					$count = $self->handler->query('SELECT FOUND_ROWS()')->fetchColumn();
					break;

				// result count as integer
				case PAIR_DB_COUNT:
				case 'count':
					$res = (int)$stat->fetch(\PDO::FETCH_COLUMN);
					$count = $res;
					break;
						
			}
			
			$self->logParamQuery($query, $count, $params);
			
		} catch (\PDOException $e) {
			
			$self->handleException($e, $params);
			
		}
		
		$stat->closeCursor();
		
		return $res;
		
	}
public static function load(string $query, ?array $params=array(), $option=NULL) {
		
		$self = static::getInstance();
		
		$self->openConnection();
		
		$res = NULL;
		
		try {

			// prepare query
			$stat = $self->handler->prepare($query);
			
			// bind parameters
			$stat->execute((array)$params);

			switch (strtolower($option)) {
				
				// list of stdClass objects
				default:
				case PAIR_DB_OBJECT_LIST:
				case 'objectlist':
					$res = $stat->fetchAll(\PDO::FETCH_OBJ);
					$count = count($res);
					break;
				
				// first row as stdClass object
				case PAIR_DB_OBJECT:
				case 'object':
					$res = $stat->fetch(\PDO::FETCH_OBJ);
					$count = (bool)$res;
					break;

				// array of first column results
				case PAIR_DB_RESULT_LIST:
				case 'resultlist':
					$res = $stat->fetchAll(\PDO::FETCH_COLUMN);
					$count = count($res);
					break;
			
				// first column of first row
				case PAIR_DB_RESULT:
				case 'result':
					$res = $stat->fetch(\PDO::FETCH_COLUMN);
					$count = $self->handler->query('SELECT FOUND_ROWS()')->fetchColumn();
					break;

				// result count as integer
				case PAIR_DB_COUNT:
				case 'count':
					$res = (int)$stat->fetch(\PDO::FETCH_COLUMN);
					$count = $res;
					break;
						
			}
			
			$self->logParamQuery($query, $count, $params);
			
		} catch (\PDOException $e) {
			
			$self->handleException($e, $params);
			
		}
		
		$stat->closeCursor();
		
		return $res;
		
	}
public static function load ( string $ query , ? array $ params = array ( ) , $ option = NULL ) { $ self = static :: getInstance ( ) ; $ self -> openConnection ( ) ; $ res = NULL ; try { // prepare query
 $ stat = $ self -> handler -> prepare ( $ query ) ; // bind parameters
 $ stat -> execute ( ( array ) $ params ) ; switch ( strtolower ( $ option ) ) { // list of stdClass objects
 default : case PAIR_DB_OBJECT_LIST : case 'objectlist' : $ res = $ stat -> fetchAll ( \ PDO :: FETCH_OBJ ) ; $ count = count ( $ res ) ; break ; // first row as stdClass object
 case PAIR_DB_OBJECT : case 'object' : $ res = $ stat -> fetch ( \ PDO :: FETCH_OBJ ) ; $ count = ( bool ) $ res ; break ; // array of first column results
 case PAIR_DB_RESULT_LIST : case 'resultlist' : $ res = $ stat -> fetchAll ( \ PDO :: FETCH_COLUMN ) ; $ count = count ( $ res ) ; break ; // first column of first row
 case PAIR_DB_RESULT : case 'result' : $ res = $ stat -> fetch ( \ PDO :: FETCH_COLUMN ) ; $ count = $ self -> handler -> query ( 'SELECT FOUND_ROWS()' ) -> fetchColumn ( ) ; break ; // result count as integer
 case PAIR_DB_COUNT : case 'count' : $ res = ( int ) $ stat -> fetch ( \ PDO :: FETCH_COLUMN ) ; $ count = $ res ; break ; } $ self -> logParamQuery ( $ query , $ count , $ params ) ; } catch ( \ PDOException $ e ) { $ self -> handleException ( $ e , $ params ) ; } $ stat -> closeCursor ( ) ; return $ res ; }
Return data in various formats by third string parameter. Default is PAIR_DB_OBJECT_LIST parameters
as array. Support PDO parameters bind.

@param	string	SQL query.
@param	array	List of parameters to bind on the sql query.
@param	string	Returned type (see constants PAIR_DB_*). PAIR_DB_OBJECT_LIST is default.

@return	array|stdClass|int|NULL
Return data in various formats by third string parameter . Default is PAIR_DB_OBJECT_LIST parameters as array . Support PDO parameters bind .