Code Duplication    Length = 16-16 lines in 2 locations

Traits/ManagerObjectTrait.php 2 locations

@@ 89-104 (lines=16) @@
86
        return $datas;
87
    }
88
89
    protected function addNameConstraint(QueryBuilder $query,$names)
90
    {
91
        if($names)
92
        {
93
            if(is_array($names))
94
            {
95
                $names = $this->slugify($names);
96
                $query->where($query->expr()->in('t.slug', $names));
97
            }else{
98
                $query->andWhere('t.slug = :slug')
99
                    ->setParameter('slug',Urlizer::urlize($names))
100
                ;
101
            }
102
        }
103
        return $query;
104
    }
105
106
    protected function addModelTypeConstraint(QueryBuilder $query,$modelType)
107
    {
@@ 106-121 (lines=16) @@
103
        return $query;
104
    }
105
106
    protected function addModelTypeConstraint(QueryBuilder $query,$modelType)
107
    {
108
        if($modelType)
109
        {
110
            if(is_array($modelType))
111
            {
112
                $modelType = $this->slugify($modelType);
113
                $query->andWhere($query->expr()->in('tr.model', $modelType));
114
            }else{
115
                $query->andWhere('tr.model = :model')
116
                    ->setParameter('model',$modelType)
117
                ;
118
            }
119
        }
120
        return $query;
121
    }
122
123
    protected function queryRelation(Taggable $model)
124
    {