Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 953-966 (lines=14) @@
950
     * @param      string $keyType The type of keys the array uses.
951
     * @return void
952
     */
953
    public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
954
    {
955
        $keys = ChannelTableMap::getFieldNames($keyType);
956
957
        if (array_key_exists($keys[0], $arr)) {
958
            $this->setId($arr[$keys[0]]);
959
        }
960
        if (array_key_exists($keys[1], $arr)) {
961
            $this->setInstanceName($arr[$keys[1]]);
962
        }
963
        if (array_key_exists($keys[2], $arr)) {
964
            $this->setName($arr[$keys[2]]);
965
        }
966
    }
967
968
     /**
969
     * Populate the current object from a string, using a given parser format

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

@@ 1004-1017 (lines=14) @@
1001
     * @param      string $keyType The type of keys the array uses.
1002
     * @return void
1003
     */
1004
    public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
1005
    {
1006
        $keys = UserTableMap::getFieldNames($keyType);
1007
1008
        if (array_key_exists($keys[0], $arr)) {
1009
            $this->setId($arr[$keys[0]]);
1010
        }
1011
        if (array_key_exists($keys[1], $arr)) {
1012
            $this->setInstanceName($arr[$keys[1]]);
1013
        }
1014
        if (array_key_exists($keys[2], $arr)) {
1015
            $this->setName($arr[$keys[2]]);
1016
        }
1017
    }
1018
1019
     /**
1020
     * Populate the current object from a string, using a given parser format