-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from martin-georgiev/develop
Release version 0.9
- Loading branch information
Showing
44 changed files
with
244 additions
and
61 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: php | ||
php: | ||
- '5.5' | ||
- '5.6' | ||
- '7.0' | ||
- '7.1' | ||
- hhvm | ||
- nightly | ||
install: composer install | ||
script: | ||
- vendor/bin/phpunit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
/** | ||
* Abstract handling of PostgreSql array data types | ||
* @see http://www.postgresql.org/docs/9.4/static/arrays.html | ||
* @see https://www.postgresql.org/docs/9.4/static/arrays.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql BIGINT[] data type | ||
* @see http://www.postgresql.org/docs/9.4/static/arrays.html | ||
* @see https://www.postgresql.org/docs/9.4/static/arrays.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql INTEGER[] data type | ||
* @see http://www.postgresql.org/docs/9.4/static/arrays.html | ||
* @see https://www.postgresql.org/docs/9.4/static/arrays.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
/** | ||
* Implementation of PostgreSql JSONB data type | ||
* @see http://www.postgresql.org/docs/9.4/static/datatype-json.html | ||
* @see https://www.postgresql.org/docs/9.4/static/datatype-json.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql JSONB[] data type | ||
* @see http://www.postgresql.org/docs/9.4/static/arrays.html | ||
* @see https://www.postgresql.org/docs/9.4/static/arrays.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql SMALLINT[] data type | ||
* @see http://www.postgresql.org/docs/9.4/static/arrays.html | ||
* @see https://www.postgresql.org/docs/9.4/static/arrays.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 |
---|---|---|
|
@@ -3,10 +3,11 @@ | |
namespace MartinGeorgiev\Doctrine\DBAL\Types; | ||
|
||
use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
use MartinGeorgiev\Utils\DataStructure; | ||
|
||
/** | ||
* Implementation of PostgreSql TEXT[] data type | ||
* @see http://www.postgresql.org/docs/9.4/static/arrays.html | ||
* @see https://www.postgresql.org/docs/9.4/static/arrays.html | ||
* | ||
* @since 0.6 | ||
* @author Martin Georgiev <[email protected]> | ||
|
@@ -24,7 +25,7 @@ class TextArray extends AbstractType | |
* @param mixed $value The value to convert. | ||
* @param AbstractPlatform $platform The currently used database platform. | ||
* | ||
* @return string The database representation of the value. | ||
* @return null|string The database representation of the value. | ||
*/ | ||
public function convertToDatabaseValue($value, AbstractPlatform $platform) | ||
{ | ||
|
@@ -38,7 +39,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) | |
/** | ||
* @param array $phpTextArray | ||
* | ||
* @return string | ||
* @return bool|string | ||
*/ | ||
protected function transformToPostgresTextArray($phpTextArray) | ||
{ | ||
|
@@ -48,7 +49,7 @@ protected function transformToPostgresTextArray($phpTextArray) | |
if (empty($phpTextArray)) { | ||
return '{}'; | ||
} | ||
return '{"' . join('","', $phpTextArray) . '"}'; | ||
return DataStructure::transformPHPArrayToPostgresTextArray($phpTextArray); | ||
} | ||
|
||
/** | ||
|
@@ -57,7 +58,7 @@ protected function transformToPostgresTextArray($phpTextArray) | |
* @param string $value The value to convert. | ||
* @param AbstractPlatform $platform The currently used database platform. | ||
* | ||
* @return array The PHP representation of the value. | ||
* @return null|array The PHP representation of the value. | ||
*/ | ||
public function convertToPHPValue($value, AbstractPlatform $platform) | ||
{ | ||
|
@@ -78,7 +79,7 @@ protected function transformFromPostgresTextArray($postgresValue) | |
if ($postgresValue === '{}') { | ||
return []; | ||
} | ||
$trimmedPostgresValue = mb_substr($postgresValue, 2, -2); | ||
return explode('","', $trimmedPostgresValue); | ||
|
||
return DataStructure::transformPostgresTextArrayToPHPArray($postgresValue); | ||
} | ||
} |
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql ALL() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-subquery.html#FUNCTIONS-SUBQUERY-ALL | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-subquery.html#FUNCTIONS-SUBQUERY-ALL | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql ANY() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-subquery.html#FUNCTIONS-SUBQUERY-ANY-SOME | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-subquery.html#FUNCTIONS-SUBQUERY-ANY-SOME | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql ARRAY[] | ||
* @see http://www.postgresql.org/docs/9.4/static/arrays.html | ||
* @see https://www.postgresql.org/docs/9.4/static/arrays.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql ARRAY_APPEND() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql check if two arrays have elements in common (using &&) | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql CARDINALITY() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql ARRAY_CAT() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
20 changes: 20 additions & 0 deletions
20
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ArrayLength.php
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace MartinGeorgiev\Doctrine\ORM\Query\AST\Functions; | ||
|
||
/** | ||
* Implementation of PostgreSql ARRAY_LENGTH() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.9 | ||
* @author Martin Georgiev <[email protected]> | ||
*/ | ||
class ArrayLength extends AbstractFunction | ||
{ | ||
protected function customiseFunction() | ||
{ | ||
$this->setFunctionPrototype('array_length(%s, %s)'); | ||
$this->addLiteralMapping('StringPrimary'); | ||
$this->addLiteralMapping('InputParameter'); | ||
} | ||
} |
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql ARRAY_PREPEND() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql ARRAY_REMOVE() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql ARRAY_REPLACE() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql ARRAY_TO_STRING() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql check if left side contains right side (using @>) | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
|
||
/** | ||
* Implementation of PostgreSql GREATEST() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-conditional.html#FUNCTIONS-GREATEST-LEAST | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-conditional.html#FUNCTIONS-GREATEST-LEAST | ||
* | ||
* @since 0.7 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql STRING_TO_ARRAY() | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.4 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql check if left side is contained by right side (using <@) | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql json field retrival, filtered by key (using ->) | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-json.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-json.html | ||
* | ||
* @since 0.1 | ||
* @author Martin Georgiev <[email protected]> | ||
|
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 @@ | |
|
||
/** | ||
* Implementation of PostgreSql json field retrival as integer, filtered by key (using ->> and type casting to BIGINT) | ||
* @see http://www.postgresql.org/docs/9.4/static/functions-json.html | ||
* @see https://www.postgresql.org/docs/9.4/static/functions-json.html | ||
* | ||
* @since 0.3 | ||
* @author Martin Georgiev <[email protected]> | ||
|
Oops, something went wrong.