Code Duplication    Length = 23-23 lines in 3 locations

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

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

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

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

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

@@ 1107-1129 (lines=23) @@
1104
     * @param      string $keyType The type of keys the array uses.
1105
     * @return void
1106
     */
1107
    public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
1108
    {
1109
        $keys = PageLinkTableMap::getFieldNames($keyType);
1110
1111
        if (array_key_exists($keys[0], $arr)) {
1112
            $this->setId($arr[$keys[0]]);
1113
        }
1114
        if (array_key_exists($keys[1], $arr)) {
1115
            $this->setPageId($arr[$keys[1]]);
1116
        }
1117
        if (array_key_exists($keys[2], $arr)) {
1118
            $this->setActiveFrom($arr[$keys[2]]);
1119
        }
1120
        if (array_key_exists($keys[3], $arr)) {
1121
            $this->setActiveTo($arr[$keys[3]]);
1122
        }
1123
        if (array_key_exists($keys[4], $arr)) {
1124
            $this->setShowOn($arr[$keys[4]]);
1125
        }
1126
        if (array_key_exists($keys[5], $arr)) {
1127
            $this->setPermanent($arr[$keys[5]]);
1128
        }
1129
    }
1130
1131
     /**
1132
     * Populate the current object from a string, using a given parser format