Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 1068-1090 (lines=23) @@
1065
     * @param      string $keyType The type of keys the array uses.
1066
     * @return void
1067
     */
1068
    public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
1069
    {
1070
        $keys = BannerImageI18nTableMap::getFieldNames($keyType);
1071
1072
        if (array_key_exists($keys[0], $arr)) {
1073
            $this->setId($arr[$keys[0]]);
1074
        }
1075
        if (array_key_exists($keys[1], $arr)) {
1076
            $this->setLocale($arr[$keys[1]]);
1077
        }
1078
        if (array_key_exists($keys[2], $arr)) {
1079
            $this->setSrc($arr[$keys[2]]);
1080
        }
1081
        if (array_key_exists($keys[3], $arr)) {
1082
            $this->setName($arr[$keys[3]]);
1083
        }
1084
        if (array_key_exists($keys[4], $arr)) {
1085
            $this->setClicks($arr[$keys[4]]);
1086
        }
1087
        if (array_key_exists($keys[5], $arr)) {
1088
            $this->setDescription($arr[$keys[5]]);
1089
        }
1090
    }
1091
1092
     /**
1093
     * Populate the current object from a string, using a given parser format

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

@@ 1133-1155 (lines=23) @@
1130
     * @param      string $keyType The type of keys the array uses.
1131
     * @return void
1132
     */
1133
    public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
1134
    {
1135
        $keys = BannersTableMap::getFieldNames($keyType);
1136
1137
        if (array_key_exists($keys[0], $arr)) {
1138
            $this->setId($arr[$keys[0]]);
1139
        }
1140
        if (array_key_exists($keys[1], $arr)) {
1141
            $this->setPlace($arr[$keys[1]]);
1142
        }
1143
        if (array_key_exists($keys[2], $arr)) {
1144
            $this->setWidth($arr[$keys[2]]);
1145
        }
1146
        if (array_key_exists($keys[3], $arr)) {
1147
            $this->setHeight($arr[$keys[3]]);
1148
        }
1149
        if (array_key_exists($keys[4], $arr)) {
1150
            $this->setEffects($arr[$keys[4]]);
1151
        }
1152
        if (array_key_exists($keys[5], $arr)) {
1153
            $this->setPageType($arr[$keys[5]]);
1154
        }
1155
    }
1156
1157
     /**
1158
     * Populate the current object from a string, using a given parser format