depage-xmldb
v2.3.1
XML documents in a relational database
Toggle main menu visibility
Loading...
Searching...
No Matches
IdentifierChecker.php
Go to the documentation of this file.
1
<?php
2
12
13
namespace
Depage\XmlDb\Helpers;
14
15
use Depage\XmlDb\Exceptions\XmlDbException;
16
21
trait IdentifierChecker
22
{
28
protected
function
checkIdentifier(
string
$name,
string
$kind =
'column'
): string
29
{
30
if
(!preg_match(
'/^[A-Za-z_][A-Za-z0-9_]*$/'
, $name)) {
31
throw
new
XmlDbException
(
"Can not use \"$name\" as a $kind name."
);
32
}
33
34
return
$name;
35
}
36
}
37
38
/* vim:set ft=php sw=4 sts=4 fdm=marker et : */
Depage\XmlDb\Exceptions\XmlDbException
Definition
XmlDbException.php:10
Helpers
IdentifierChecker.php
Generated on
for depage-xmldb by
doxygen
1.18.0
For an overview of all docs, go to
docs.depage.net