Code Duplication    Length = 29-29 lines in 5 locations

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

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

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

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

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

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

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

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

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

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