Code Duplication    Length = 23-23 lines in 4 locations

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

@@ 1179-1201 (lines=23) @@
1176
     *
1177
     * @return int Hashcode
1178
     */
1179
    public function hashCode()
1180
    {
1181
        $validPk = null !== $this->getId() &&
1182
            null !== $this->getLocale();
1183
1184
        $validPrimaryKeyFKs = 1;
1185
        $primaryKeyFKs = [];
1186
1187
        //relation banner_image_i18n_fk_03c8df to table banner_image
1188
        if ($this->aBannerImage && $hash = spl_object_hash($this->aBannerImage)) {
1189
            $primaryKeyFKs[] = $hash;
1190
        } else {
1191
            $validPrimaryKeyFKs = false;
1192
        }
1193
1194
        if ($validPk) {
1195
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
1196
        } elseif ($validPrimaryKeyFKs) {
1197
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
1198
        }
1199
1200
        return spl_object_hash($this);
1201
    }
1202
1203
    /**
1204
     * Returns the composite primary key for this object.

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

@@ 1002-1024 (lines=23) @@
999
     *
1000
     * @return int Hashcode
1001
     */
1002
    public function hashCode()
1003
    {
1004
        $validPk = null !== $this->getId() &&
1005
            null !== $this->getLocale();
1006
1007
        $validPrimaryKeyFKs = 1;
1008
        $primaryKeyFKs = [];
1009
1010
        //relation banners_i18n_fk_c926a5 to table banners
1011
        if ($this->aBanners && $hash = spl_object_hash($this->aBanners)) {
1012
            $primaryKeyFKs[] = $hash;
1013
        } else {
1014
            $validPrimaryKeyFKs = false;
1015
        }
1016
1017
        if ($validPk) {
1018
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
1019
        } elseif ($validPrimaryKeyFKs) {
1020
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
1021
        }
1022
1023
        return spl_object_hash($this);
1024
    }
1025
1026
    /**
1027
     * Returns the composite primary key for this object.

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

@@ 925-947 (lines=23) @@
922
     *
923
     * @return int Hashcode
924
     */
925
    public function hashCode()
926
    {
927
        $validPk = null !== $this->getLinkId() &&
928
            null !== $this->getProductId();
929
930
        $validPrimaryKeyFKs = 1;
931
        $primaryKeyFKs = [];
932
933
        //relation page_link_product_fk_5a23ad to table page_link
934
        if ($this->aPageLink && $hash = spl_object_hash($this->aPageLink)) {
935
            $primaryKeyFKs[] = $hash;
936
        } else {
937
            $validPrimaryKeyFKs = false;
938
        }
939
940
        if ($validPk) {
941
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
942
        } elseif ($validPrimaryKeyFKs) {
943
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
944
        }
945
946
        return spl_object_hash($this);
947
    }
948
949
    /**
950
     * Returns the composite primary key for this object.

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

@@ 925-947 (lines=23) @@
922
     *
923
     * @return int Hashcode
924
     */
925
    public function hashCode()
926
    {
927
        $validPk = null !== $this->getLinkId() &&
928
            null !== $this->getProductId();
929
930
        $validPrimaryKeyFKs = 1;
931
        $primaryKeyFKs = [];
932
933
        //relation page_link_products_fk_5a23ad to table page_link
934
        if ($this->aPageLink && $hash = spl_object_hash($this->aPageLink)) {
935
            $primaryKeyFKs[] = $hash;
936
        } else {
937
            $validPrimaryKeyFKs = false;
938
        }
939
940
        if ($validPk) {
941
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
942
        } elseif ($validPrimaryKeyFKs) {
943
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
944
        }
945
946
        return spl_object_hash($this);
947
    }
948
949
    /**
950
     * Returns the composite primary key for this object.