Skip to content

Commit

Permalink
Run CS Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
usernane committed Jul 26, 2023
1 parent cceee54 commit f202387
Show file tree
Hide file tree
Showing 12 changed files with 267 additions and 274 deletions.
2 changes: 0 additions & 2 deletions samples/connect-to-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

use webfiori\database\ConnectionInfo;
use webfiori\database\Database;
use webfiori\database\DatabaseException;

//This assumes that MySQL is installed on locahost
//and root password is set to '123456'
//and there is a schema with name 'testing_db'
$connection = new ConnectionInfo('mysql', 'root', '123456', 'testing_db');
$database = new Database($connection);

3 changes: 2 additions & 1 deletion samples/createEntity/using-entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
->select()
->execute();

$mappedSet = $resultSet->map(function (array $record) {
$mappedSet = $resultSet->map(function (array $record)
{
return UserInformation::map($record);
});

Expand Down
32 changes: 16 additions & 16 deletions webfiori/database/AbstractQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
* @version 1.0.4
*/
abstract class AbstractQuery {
/**
*
* @var InsertHelper
*/
private $insertHelper;
/**
*
* @var Table|null
*
* @since 1.0
*/
private $associatedTbl;
/**
*
* @var InsertHelper
*/
private $insertHelper;
/**
*
* @var boolean
Expand Down Expand Up @@ -104,10 +104,6 @@ public function __construct() {
$this->params = [];
$this->isPrepare = false;
}
public function setInsertBuilder(InsertBuilder $builder) {
$this->insertHelper = $builder;
$this->setQuery($builder->getQuery());
}
/**
* Constructs a query that can be used to add a column to a database table.
*
Expand Down Expand Up @@ -361,6 +357,13 @@ public function execute() {
throw new DatabaseException($ex->getMessage(), $ex->getCode(), $errQuery, $ex);
}
}
/**
*
* @return InsertBuilder|null
*/
public function getInsertBuilder() {
return $this->insertHelper;
}
/**
* Returns the type of last generated SQL query.
*
Expand Down Expand Up @@ -506,13 +509,6 @@ public function groupBy($colOrColsArr) {
* @since 1.0
*/
public abstract function insert(array $colsAndVals);
/**
*
* @return InsertBuilder|null
*/
public function getInsertBuilder() {
return $this->insertHelper;
}
/**
* Checks if the query represents a multi-query.
*
Expand Down Expand Up @@ -940,6 +936,10 @@ public function selectMin($colName, $alias = 'min') {

return $this;
}
public function setInsertBuilder(InsertBuilder $builder) {
$this->insertHelper = $builder;
$this->setQuery($builder->getQuery());
}
/**
* Sets the parameters which will be used in case the query will be prepared.
*
Expand Down
Loading

0 comments on commit f202387

Please sign in to comment.