Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
dcba3b76
Commit
dcba3b76
authored
Feb 11, 2016
by
Carsten Rose
Browse files
BindParam: preparation for call_user_func
parent
7a129dad
Changes
1
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/helper/BindParam.php
0 → 100644
View file @
dcba3b76
<?php
/**
* Created by PhpStorm.
* User: nick9v at hotmail dot com ¶
* Date: 2/10/16
* Time: 2:05 PM
*/
namespace
qfq
;
class
BindParam
{
private
$values
=
array
(),
$types
=
''
;
public
function
add
(
&
$value
)
{
$this
->
values
[]
=
$value
;
$this
->
types
.
=
$this
->
getParameterBindType
(
$value
);
}
/**
* Depending of $value, returns i (integer), d (double) or s (string). This is needed for mysqli_bind().
*
* @param $value
* @return string
*/
private
function
getParameterBindType
(
$value
)
{
if
(
is_int
(
$value
))
{
$type
=
'i'
;
}
elseif
(
is_double
(
$value
))
{
$type
=
'd'
;
}
else
{
$type
=
's'
;
}
return
$type
;
}
public
function
get
()
{
return
array_merge
(
array
(
$this
->
types
),
$this
->
values
);
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
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