lib/public/AppFramework/Db/Mapper.php
/**
	 * Runs an sql query
	 * @param string $sql the prepare string
	 * @param array $params the params which should replace the ? in the sql query
	 * @param int $limit the maximum number of rows
	 * @param int $offset from which row we want to start
	 * @return \PDOStatement the database query result
	 * @since 7.0.0
	 */
Runs an sql query
@param string $sql the prepare string
@param array $params the params which should replace the . in the sql query
@param int $limit the maximum number of rows
@param int $offset from which row we want to start
@return \PDOStatement the database query result
@since 7.0.0
Runs an sql query @param string $sql the prepare string @param array $params the params which should replace the . in the sql query @param int $limit the maximum number of rows @param int $offset from which row we want to start @return \ PDOStatement the database query result @since 7 . 0 . 0
protected function execute($sql, array $params=[], $limit=null, $offset=null){
		$query = $this->db->prepare($sql, $limit, $offset);
		if ($this->isAssocArray($params)) {
			foreach ($params as $key => $param) {
				$pdoConstant = $this->getPDOType($param);
				$query->bindValue($key, $param, $pdoConstant);
			}
		} else {
			$index = 1;  
			foreach ($params as $param) {
				$pdoConstant = $this->getPDOType($param);
				$query->bindValue($index, $param, $pdoConstant);
				$index++;
			}
		}
		$result = $query->execute();
		return $query;
	}
protected function execute ( $ sql , array $ params = [ ] , $ limit = null , $ offset = null ) { $ query = $ this -> db -> prepare ( $ sql , $ limit , $ offset ) ; if ( $ this -> isAssocArray ( $ params ) ) { foreach ( $ params as $ key => $ param ) { $ pdoConstant = $ this -> getPDOType ( $ param ) ; $ query -> bindValue ( $ key , $ param , $ pdoConstant ) ; } } else { $ index = 1 ; foreach ( $ params as $ param ) { $ pdoConstant = $ this -> getPDOType ( $ param ) ; $ query -> bindValue ( $ index , $ param , $ pdoConstant ) ; $ index ++ ; } } $ result = $ query -> execute ( ) ; return $ query ; }
Runs an sql query
 @param string $sql the prepare string
 @param array $params the params which should replace the ?
Runs an sql query @param string $sql the prepare string @param array $params the params which should replace the ?
// bindParam is 1 indexed