Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CWD
CwdDataDoctrineORMBundle
Commits
f20563e1
Commit
f20563e1
authored
Jan 13, 2019
by
Bernhard Schussek
Browse files
Merge branch 'feature/int-array-type' into 'master'
Added integer_array type See merge request
!7
parents
3a86b753
9f8bc8bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Type/FloatArrayType.php
View file @
f20563e1
...
...
@@ -29,12 +29,7 @@ class FloatArrayType extends ArrayType
{
$convertedValue
=
parent
::
convertToPHPValue
(
$value
,
$platform
);
return
array_map
(
function
(
string
$value
):
string
{
return
trim
(
$value
,
'"'
);
},
$convertedValue
);
return
array_map
(
'floatval'
,
$convertedValue
);
}
/**
...
...
Type/IntegerArrayType.php
0 → 100644
View file @
f20563e1
<?php
/*
* This file is part of the CWD Data Doctrine ORM Bundle
*
* (c) cwd.at GmbH <office@cwd.at>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare
(
strict_types
=
1
);
namespace
Cwd\DataDoctrineORMBundle\Type
;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
/**
* An array of integers.
*/
class
IntegerArrayType
extends
ArrayType
{
use
GeneratedName
;
/**
* {@inheritdoc}
*/
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
{
$convertedValue
=
parent
::
convertToPHPValue
(
$value
,
$platform
);
return
array_map
(
'intval'
,
$convertedValue
);
}
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
{
return
'INT[]'
;
}
/**
* {@inheritdoc}
*/
public
function
getMappedDatabaseTypes
(
AbstractPlatform
$platform
)
{
return
[
'_int'
];
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment