Code Duplication    Length = 13-13 lines in 6 locations

packages/selfprice/src/Models/Selfprice/Base/SelfpriceQuery.php 2 locations

@@ 295-307 (lines=13) @@
292
     *
293
     * @return $this|ChildSelfpriceQuery The current query, for fluid interface
294
     */
295
    public function filterByName($name = null, $comparison = null)
296
    {
297
        if (null === $comparison) {
298
            if (is_array($name)) {
299
                $comparison = Criteria::IN;
300
            } elseif (preg_match('/[\%\*]/', $name)) {
301
                $name = str_replace('*', '%', $name);
302
                $comparison = Criteria::LIKE;
303
            }
304
        }
305
306
        return $this->addUsingAlias(SelfpriceTableMap::COL_NAME, $name, $comparison);
307
    }
308
309
    /**
310
     * Filter the query on the datecreate column
@@ 367-379 (lines=13) @@
364
     *
365
     * @return $this|ChildSelfpriceQuery The current query, for fluid interface
366
     */
367
    public function filterByDesc($desc = null, $comparison = null)
368
    {
369
        if (null === $comparison) {
370
            if (is_array($desc)) {
371
                $comparison = Criteria::IN;
372
            } elseif (preg_match('/[\%\*]/', $desc)) {
373
                $desc = str_replace('*', '%', $desc);
374
                $comparison = Criteria::LIKE;
375
            }
376
        }
377
378
        return $this->addUsingAlias(SelfpriceTableMap::COL_DESC, $desc, $comparison);
379
    }
380
381
    /**
382
     * Exclude object from result

packages/core/src/Models/User/Base/UserQuery.php 4 locations

@@ 320-332 (lines=13) @@
317
     *
318
     * @return $this|ChildUserQuery The current query, for fluid interface
319
     */
320
    public function filterByName($name = null, $comparison = null)
321
    {
322
        if (null === $comparison) {
323
            if (is_array($name)) {
324
                $comparison = Criteria::IN;
325
            } elseif (preg_match('/[\%\*]/', $name)) {
326
                $name = str_replace('*', '%', $name);
327
                $comparison = Criteria::LIKE;
328
            }
329
        }
330
331
        return $this->addUsingAlias(UserTableMap::COL_NAME, $name, $comparison);
332
    }
333
334
    /**
335
     * Filter the query on the email column
@@ 349-361 (lines=13) @@
346
     *
347
     * @return $this|ChildUserQuery The current query, for fluid interface
348
     */
349
    public function filterByEmail($email = null, $comparison = null)
350
    {
351
        if (null === $comparison) {
352
            if (is_array($email)) {
353
                $comparison = Criteria::IN;
354
            } elseif (preg_match('/[\%\*]/', $email)) {
355
                $email = str_replace('*', '%', $email);
356
                $comparison = Criteria::LIKE;
357
            }
358
        }
359
360
        return $this->addUsingAlias(UserTableMap::COL_EMAIL, $email, $comparison);
361
    }
362
363
    /**
364
     * Filter the query on the password column
@@ 378-390 (lines=13) @@
375
     *
376
     * @return $this|ChildUserQuery The current query, for fluid interface
377
     */
378
    public function filterByPassword($password = null, $comparison = null)
379
    {
380
        if (null === $comparison) {
381
            if (is_array($password)) {
382
                $comparison = Criteria::IN;
383
            } elseif (preg_match('/[\%\*]/', $password)) {
384
                $password = str_replace('*', '%', $password);
385
                $comparison = Criteria::LIKE;
386
            }
387
        }
388
389
        return $this->addUsingAlias(UserTableMap::COL_PASSWORD, $password, $comparison);
390
    }
391
392
    /**
393
     * Filter the query on the remember_token column
@@ 407-419 (lines=13) @@
404
     *
405
     * @return $this|ChildUserQuery The current query, for fluid interface
406
     */
407
    public function filterByRememberToken($rememberToken = null, $comparison = null)
408
    {
409
        if (null === $comparison) {
410
            if (is_array($rememberToken)) {
411
                $comparison = Criteria::IN;
412
            } elseif (preg_match('/[\%\*]/', $rememberToken)) {
413
                $rememberToken = str_replace('*', '%', $rememberToken);
414
                $comparison = Criteria::LIKE;
415
            }
416
        }
417
418
        return $this->addUsingAlias(UserTableMap::COL_REMEMBER_TOKEN, $rememberToken, $comparison);
419
    }
420
421
    /**
422
     * Filter the query on the created_at column