Code Duplication    Length = 29-29 lines in 5 locations

application/modules/xbanners/models/Base/BannerImage.php 1 location

@@ 2246-2274 (lines=29) @@
2243
     *
2244
     * @return array|string
2245
     */
2246
    public function __call($name, $params)
2247
    {
2248
        if (0 === strpos($name, 'get')) {
2249
            $virtualColumn = substr($name, 3);
2250
            if ($this->hasVirtualColumn($virtualColumn)) {
2251
                return $this->getVirtualColumn($virtualColumn);
2252
            }
2253
2254
            $virtualColumn = lcfirst($virtualColumn);
2255
            if ($this->hasVirtualColumn($virtualColumn)) {
2256
                return $this->getVirtualColumn($virtualColumn);
2257
            }
2258
        }
2259
2260
        if (0 === strpos($name, 'from')) {
2261
            $format = substr($name, 4);
2262
2263
            return $this->importFrom($format, reset($params));
2264
        }
2265
2266
        if (0 === strpos($name, 'to')) {
2267
            $format = substr($name, 2);
2268
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
2269
2270
            return $this->exportTo($format, $includeLazyLoadColumns);
2271
        }
2272
2273
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
2274
    }
2275
2276
}
2277

application/modules/xbanners/models/Base/BannerImageI18n.php 1 location

@@ 1493-1521 (lines=29) @@
1490
     *
1491
     * @return array|string
1492
     */
1493
    public function __call($name, $params)
1494
    {
1495
        if (0 === strpos($name, 'get')) {
1496
            $virtualColumn = substr($name, 3);
1497
            if ($this->hasVirtualColumn($virtualColumn)) {
1498
                return $this->getVirtualColumn($virtualColumn);
1499
            }
1500
1501
            $virtualColumn = lcfirst($virtualColumn);
1502
            if ($this->hasVirtualColumn($virtualColumn)) {
1503
                return $this->getVirtualColumn($virtualColumn);
1504
            }
1505
        }
1506
1507
        if (0 === strpos($name, 'from')) {
1508
            $format = substr($name, 4);
1509
1510
            return $this->importFrom($format, reset($params));
1511
        }
1512
1513
        if (0 === strpos($name, 'to')) {
1514
            $format = substr($name, 2);
1515
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
1516
1517
            return $this->exportTo($format, $includeLazyLoadColumns);
1518
        }
1519
1520
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
1521
    }
1522
1523
}
1524

application/modules/xbanners/models/Base/Banners.php 1 location

@@ 2122-2150 (lines=29) @@
2119
     *
2120
     * @return array|string
2121
     */
2122
    public function __call($name, $params)
2123
    {
2124
        if (0 === strpos($name, 'get')) {
2125
            $virtualColumn = substr($name, 3);
2126
            if ($this->hasVirtualColumn($virtualColumn)) {
2127
                return $this->getVirtualColumn($virtualColumn);
2128
            }
2129
2130
            $virtualColumn = lcfirst($virtualColumn);
2131
            if ($this->hasVirtualColumn($virtualColumn)) {
2132
                return $this->getVirtualColumn($virtualColumn);
2133
            }
2134
        }
2135
2136
        if (0 === strpos($name, 'from')) {
2137
            $format = substr($name, 4);
2138
2139
            return $this->importFrom($format, reset($params));
2140
        }
2141
2142
        if (0 === strpos($name, 'to')) {
2143
            $format = substr($name, 2);
2144
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
2145
2146
            return $this->exportTo($format, $includeLazyLoadColumns);
2147
        }
2148
2149
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
2150
    }
2151
2152
}
2153

application/modules/xbanners/models/Base/BannersI18n.php 1 location

@@ 1310-1338 (lines=29) @@
1307
     *
1308
     * @return array|string
1309
     */
1310
    public function __call($name, $params)
1311
    {
1312
        if (0 === strpos($name, 'get')) {
1313
            $virtualColumn = substr($name, 3);
1314
            if ($this->hasVirtualColumn($virtualColumn)) {
1315
                return $this->getVirtualColumn($virtualColumn);
1316
            }
1317
1318
            $virtualColumn = lcfirst($virtualColumn);
1319
            if ($this->hasVirtualColumn($virtualColumn)) {
1320
                return $this->getVirtualColumn($virtualColumn);
1321
            }
1322
        }
1323
1324
        if (0 === strpos($name, 'from')) {
1325
            $format = substr($name, 4);
1326
1327
            return $this->importFrom($format, reset($params));
1328
        }
1329
1330
        if (0 === strpos($name, 'to')) {
1331
            $format = substr($name, 2);
1332
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
1333
1334
            return $this->exportTo($format, $includeLazyLoadColumns);
1335
        }
1336
1337
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
1338
    }
1339
1340
}
1341

application/modules/core/models/Base/Route.php 1 location

@@ 2009-2037 (lines=29) @@
2006
     *
2007
     * @return array|string
2008
     */
2009
    public function __call($name, $params)
2010
    {
2011
        if (0 === strpos($name, 'get')) {
2012
            $virtualColumn = substr($name, 3);
2013
            if ($this->hasVirtualColumn($virtualColumn)) {
2014
                return $this->getVirtualColumn($virtualColumn);
2015
            }
2016
2017
            $virtualColumn = lcfirst($virtualColumn);
2018
            if ($this->hasVirtualColumn($virtualColumn)) {
2019
                return $this->getVirtualColumn($virtualColumn);
2020
            }
2021
        }
2022
2023
        if (0 === strpos($name, 'from')) {
2024
            $format = substr($name, 4);
2025
2026
            return $this->importFrom($format, reset($params));
2027
        }
2028
2029
        if (0 === strpos($name, 'to')) {
2030
            $format = substr($name, 2);
2031
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
2032
2033
            return $this->exportTo($format, $includeLazyLoadColumns);
2034
        }
2035
2036
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
2037
    }
2038
2039
}
2040