Code Duplication    Length = 32-32 lines in 2 locations

src/cli/Database/Base/Channel.php 1 location

@@ 857-888 (lines=32) @@
854
            $result[$key] = $virtualColumn;
855
        }
856
857
        if ($includeForeignObjects) {
858
            if (null !== $this->aInstance) {
859
860
                switch ($keyType) {
861
                    case TableMap::TYPE_CAMELNAME:
862
                        $key = 'instance';
863
                        break;
864
                    case TableMap::TYPE_FIELDNAME:
865
                        $key = 'instance';
866
                        break;
867
                    default:
868
                        $key = 'Instance';
869
                }
870
871
                $result[$key] = $this->aInstance->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
872
            }
873
            if (null !== $this->collSubscriptions) {
874
875
                switch ($keyType) {
876
                    case TableMap::TYPE_CAMELNAME:
877
                        $key = 'subscriptions';
878
                        break;
879
                    case TableMap::TYPE_FIELDNAME:
880
                        $key = 'subscriptions';
881
                        break;
882
                    default:
883
                        $key = 'Subscriptions';
884
                }
885
886
                $result[$key] = $this->collSubscriptions->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
887
            }
888
        }
889
890
        return $result;
891
    }

src/cli/Database/Base/Connection.php 1 location

@@ 1009-1040 (lines=32) @@
1006
            $result[$key] = $virtualColumn;
1007
        }
1008
1009
        if ($includeForeignObjects) {
1010
            if (null !== $this->aInstance) {
1011
1012
                switch ($keyType) {
1013
                    case TableMap::TYPE_CAMELNAME:
1014
                        $key = 'instance';
1015
                        break;
1016
                    case TableMap::TYPE_FIELDNAME:
1017
                        $key = 'instance';
1018
                        break;
1019
                    default:
1020
                        $key = 'Instance';
1021
                }
1022
1023
                $result[$key] = $this->aInstance->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1024
            }
1025
            if (null !== $this->aUser) {
1026
1027
                switch ($keyType) {
1028
                    case TableMap::TYPE_CAMELNAME:
1029
                        $key = 'user';
1030
                        break;
1031
                    case TableMap::TYPE_FIELDNAME:
1032
                        $key = 'user';
1033
                        break;
1034
                    default:
1035
                        $key = 'User';
1036
                }
1037
1038
                $result[$key] = $this->aUser->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1039
            }
1040
        }
1041
1042
        return $result;
1043
    }