Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathieu Loiseau
LexiconBundle
Commits
a7d439e8
Commit
a7d439e8
authored
Feb 08, 2017
by
arnaudbey
Browse files
retrieve inflection manager from magicwordbundle
parent
c6059a97
Changes
2
Hide whitespace changes
Inline
Side-by-side
Manager/InflectionManager.php
0 → 100644
View file @
a7d439e8
<?php
namespace
Innova\LexiconBundle\Manager
;
use
Innova\LexiconBundle\Entity\Language
;
class
InflectionManager
{
protected
$em
;
public
function
__construct
(
$entityManager
)
{
$this
->
em
=
$entityManager
;
}
public
function
checkExistence
(
$inflection
,
Language
$language
)
{
$inflection
=
$this
->
em
->
getRepository
(
'InnovaLexiconBundle:Inflection'
)
->
getByLanguageAndContentOrCleaned
(
$language
,
$inflection
);
return
$inflection
;
}
public
function
getCleanContent
(
$form
)
{
$str
=
mb_strtolower
(
$form
,
'UTF-8'
);
$cleanContent
=
str_replace
(
array
(
'à'
,
'â'
,
'ä'
,
'á'
,
'ã'
,
'å'
,
'î'
,
'ï'
,
'ì'
,
'í'
,
'ô'
,
'ö'
,
'ò'
,
'ó'
,
'õ'
,
'ø'
,
'ù'
,
'û'
,
'ü'
,
'ú'
,
'é'
,
'è'
,
'ê'
,
'ë'
,
'ç'
,
'ÿ'
,
'ñ'
,
'œ'
,
),
array
(
'a'
,
'a'
,
'a'
,
'a'
,
'a'
,
'a'
,
'i'
,
'i'
,
'i'
,
'i'
,
'o'
,
'o'
,
'o'
,
'o'
,
'o'
,
'o'
,
'u'
,
'u'
,
'u'
,
'u'
,
'e'
,
'e'
,
'e'
,
'e'
,
'c'
,
'y'
,
'n'
,
'oe'
,
),
$str
);
return
addslashes
(
$cleanContent
);
}
}
Resources/config/services.yml
View file @
a7d439e8
services
:
#
innova_lexicon
.example
:
#
class: Innova\LexiconBundle\
Example
#
arguments: ["@
service_id", "plain_value", "%paramet
er
%
"]
innova_lexicon
_inflection
:
class
:
Innova\LexiconBundle\
Manager\InflectionManager
arguments
:
[
"
@
doctrine.orm.entity_manag
er"
]
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