Code Duplication    Length = 29-29 lines in 7 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/mod_link/models/Base/PageLink.php 1 location

@@ 1724-1752 (lines=29) @@
1721
     *
1722
     * @return array|string
1723
     */
1724
    public function __call($name, $params)
1725
    {
1726
        if (0 === strpos($name, 'get')) {
1727
            $virtualColumn = substr($name, 3);
1728
            if ($this->hasVirtualColumn($virtualColumn)) {
1729
                return $this->getVirtualColumn($virtualColumn);
1730
            }
1731
1732
            $virtualColumn = lcfirst($virtualColumn);
1733
            if ($this->hasVirtualColumn($virtualColumn)) {
1734
                return $this->getVirtualColumn($virtualColumn);
1735
            }
1736
        }
1737
1738
        if (0 === strpos($name, 'from')) {
1739
            $format = substr($name, 4);
1740
1741
            return $this->importFrom($format, reset($params));
1742
        }
1743
1744
        if (0 === strpos($name, 'to')) {
1745
            $format = substr($name, 2);
1746
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
1747
1748
            return $this->exportTo($format, $includeLazyLoadColumns);
1749
        }
1750
1751
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
1752
    }
1753
1754
}
1755

application/modules/mod_link/models/Base/PageLinkProduct.php 1 location

@@ 1230-1258 (lines=29) @@
1227
     *
1228
     * @return array|string
1229
     */
1230
    public function __call($name, $params)
1231
    {
1232
        if (0 === strpos($name, 'get')) {
1233
            $virtualColumn = substr($name, 3);
1234
            if ($this->hasVirtualColumn($virtualColumn)) {
1235
                return $this->getVirtualColumn($virtualColumn);
1236
            }
1237
1238
            $virtualColumn = lcfirst($virtualColumn);
1239
            if ($this->hasVirtualColumn($virtualColumn)) {
1240
                return $this->getVirtualColumn($virtualColumn);
1241
            }
1242
        }
1243
1244
        if (0 === strpos($name, 'from')) {
1245
            $format = substr($name, 4);
1246
1247
            return $this->importFrom($format, reset($params));
1248
        }
1249
1250
        if (0 === strpos($name, 'to')) {
1251
            $format = substr($name, 2);
1252
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
1253
1254
            return $this->exportTo($format, $includeLazyLoadColumns);
1255
        }
1256
1257
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
1258
    }
1259
1260
}
1261

application/modules/mod_link/models/Base/PageLinkProducts.php 1 location

@@ 1210-1238 (lines=29) @@
1207
     *
1208
     * @return array|string
1209
     */
1210
    public function __call($name, $params)
1211
    {
1212
        if (0 === strpos($name, 'get')) {
1213
            $virtualColumn = substr($name, 3);
1214
            if ($this->hasVirtualColumn($virtualColumn)) {
1215
                return $this->getVirtualColumn($virtualColumn);
1216
            }
1217
1218
            $virtualColumn = lcfirst($virtualColumn);
1219
            if ($this->hasVirtualColumn($virtualColumn)) {
1220
                return $this->getVirtualColumn($virtualColumn);
1221
            }
1222
        }
1223
1224
        if (0 === strpos($name, 'from')) {
1225
            $format = substr($name, 4);
1226
1227
            return $this->importFrom($format, reset($params));
1228
        }
1229
1230
        if (0 === strpos($name, 'to')) {
1231
            $format = substr($name, 2);
1232
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
1233
1234
            return $this->exportTo($format, $includeLazyLoadColumns);
1235
        }
1236
1237
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
1238
    }
1239
1240
}
1241