-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#13 query methods now work with strings inside, was arrays
- Loading branch information
1 parent
3c043d8
commit eaa9279
Showing
33 changed files
with
244 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
namespace HS\Builder; | ||
|
||
use HS\Exception\WrongParameterException; | ||
use HS\Exception\InvalidArgumentException; | ||
|
||
/** | ||
* @author KonstantinKuklin <[email protected]> | ||
|
@@ -27,7 +27,7 @@ public function getQueryClassPath() | |
* @param array $list | ||
* | ||
* @return $this | ||
* @throws WrongParameterException | ||
* @throws InvalidArgumentException | ||
*/ | ||
public function where($comparison, array $list) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
use HS\Component\Comparison; | ||
use HS\Component\Filter; | ||
use HS\Component\InList; | ||
use HS\Exception\WrongParameterException; | ||
use HS\Exception\InvalidArgumentException; | ||
|
||
/** | ||
* @author KonstantinKuklin <[email protected]> | ||
|
@@ -68,7 +68,7 @@ public function getColumnList() | |
* @param array $list | ||
* | ||
* @return $this | ||
* @throws WrongParameterException | ||
* @throws InvalidArgumentException | ||
*/ | ||
public function where($comparison, array $list) | ||
{ | ||
|
@@ -79,7 +79,7 @@ public function where($comparison, array $list) | |
for ($i = 0, $countWhere = count($list); $i < $countWhere; $i++) { | ||
$key = $columnList[$i]; | ||
if (!isset($list[$key])) { | ||
throw new WrongParameterException( | ||
throw new InvalidArgumentException( | ||
"The key`s must be set with out skip on select( key1, key2). Where(key2,key1)" | ||
); | ||
} | ||
|
@@ -95,7 +95,7 @@ public function where($comparison, array $list) | |
* @param array $values | ||
* | ||
* @return $this | ||
* @throws \Exception | ||
* @throws InvalidArgumentException | ||
*/ | ||
public function whereIn($key, array $values) | ||
{ | ||
|
@@ -104,7 +104,7 @@ public function whereIn($key, array $values) | |
$this->getParameterBag()->setParameter('keyList', array(1)); | ||
|
||
if (false === $index = array_search($key, $columnList)) { | ||
throw new WrongParameterException("Can't find key in columns list."); | ||
throw new InvalidArgumentException("Can't find key in columns list."); | ||
} | ||
$inList = new InList($index, $values); | ||
$this->getParameterBag()->setParameter('inKeyList', $inList); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
namespace HS\Builder; | ||
|
||
use HS\Exception\WrongParameterException; | ||
use HS\Exception\InvalidArgumentException; | ||
|
||
/** | ||
* @author KonstantinKuklin <[email protected]> | ||
|
@@ -12,7 +12,7 @@ class IncrementQueryBuilder extends UpdateQueryBuilder | |
/** | ||
* @param array $incrementList | ||
* | ||
* @throws WrongParameterException | ||
* @throws InvalidArgumentException | ||
*/ | ||
public function __construct(array $incrementList) | ||
{ | ||
|
@@ -26,7 +26,7 @@ public function __construct(array $incrementList) | |
$columnList[] = $value; | ||
$valueList[] = 1; | ||
} else { | ||
throw new WrongParameterException("Wrong increment parameter."); | ||
throw new InvalidArgumentException("Wrong increment parameter."); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.