Code Duplication    Length = 41-41 lines in 2 locations

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

@@ 996-1036 (lines=41) @@
993
     *
994
     * @return array an associative array containing the field names (as keys) and field values
995
     */
996
    public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
997
    {
998
999
        if (isset($alreadyDumpedObjects['PageLink'][$this->hashCode()])) {
1000
            return '*RECURSION*';
1001
        }
1002
        $alreadyDumpedObjects['PageLink'][$this->hashCode()] = true;
1003
        $keys = PageLinkTableMap::getFieldNames($keyType);
1004
        $result = array(
1005
            $keys[0] => $this->getId(),
1006
            $keys[1] => $this->getPageId(),
1007
            $keys[2] => $this->getActiveFrom(),
1008
            $keys[3] => $this->getActiveTo(),
1009
            $keys[4] => $this->getShowOn(),
1010
            $keys[5] => $this->getPermanent(),
1011
        );
1012
        $virtualColumns = $this->virtualColumns;
1013
        foreach ($virtualColumns as $key => $virtualColumn) {
1014
            $result[$key] = $virtualColumn;
1015
        }
1016
1017
        if ($includeForeignObjects) {
1018
            if (null !== $this->collPageLinkProducts) {
1019
1020
                switch ($keyType) {
1021
                    case TableMap::TYPE_CAMELNAME:
1022
                        $key = 'pageLinkProducts';
1023
                        break;
1024
                    case TableMap::TYPE_FIELDNAME:
1025
                        $key = 'page_link_products';
1026
                        break;
1027
                    default:
1028
                        $key = 'PageLinkProducts';
1029
                }
1030
1031
                $result[$key] = $this->collPageLinkProducts->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1032
            }
1033
        }
1034
1035
        return $result;
1036
    }
1037
1038
    /**
1039
     * Sets a field from the object by name passed in as a string.

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

@@ 958-998 (lines=41) @@
955
     *
956
     * @return array an associative array containing the field names (as keys) and field values
957
     */
958
    public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
959
    {
960
961
        if (isset($alreadyDumpedObjects['BannerImageI18n'][$this->hashCode()])) {
962
            return '*RECURSION*';
963
        }
964
        $alreadyDumpedObjects['BannerImageI18n'][$this->hashCode()] = true;
965
        $keys = BannerImageI18nTableMap::getFieldNames($keyType);
966
        $result = array(
967
            $keys[0] => $this->getId(),
968
            $keys[1] => $this->getLocale(),
969
            $keys[2] => $this->getSrc(),
970
            $keys[3] => $this->getName(),
971
            $keys[4] => $this->getClicks(),
972
            $keys[5] => $this->getDescription(),
973
        );
974
        $virtualColumns = $this->virtualColumns;
975
        foreach ($virtualColumns as $key => $virtualColumn) {
976
            $result[$key] = $virtualColumn;
977
        }
978
979
        if ($includeForeignObjects) {
980
            if (null !== $this->aBannerImage) {
981
982
                switch ($keyType) {
983
                    case TableMap::TYPE_CAMELNAME:
984
                        $key = 'bannerImage';
985
                        break;
986
                    case TableMap::TYPE_FIELDNAME:
987
                        $key = 'banner_image';
988
                        break;
989
                    default:
990
                        $key = 'BannerImage';
991
                }
992
993
                $result[$key] = $this->aBannerImage->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
994
            }
995
        }
996
997
        return $result;
998
    }
999
1000
    /**
1001
     * Sets a field from the object by name passed in as a string.