Code Duplication    Length = 13-14 lines in 2 locations

src/FlexiPeeHP/FlexiBeeRO.php 2 locations

@@ 869-881 (lines=13) @@
866
     *
867
     * @return int počet načtených položek
868
     */
869
    public function loadFromFlexiBee($id = null)
870
    {
871
        $data = [];
872
        if (is_null($id)) {
873
            $id = $this->getMyKey();
874
        }
875
876
        $flexidata = $this->getFlexiData(null, '/'.$id);
877
        if (count($flexidata) == 1) {
878
            $data = current($flexidata);
879
        }
880
        return $this->takeData($data);
881
    }
882
883
    /**
884
     * Převede data do Json formátu pro FlexiBee.
@@ 956-969 (lines=14) @@
953
     *                                     sloupečku
954
     * @return array
955
     */
956
    public function getAllFromFlexibee($conditions = null, $indexBy = null)
957
    {
958
        if (is_int($conditions)) {
959
            $conditions = [$this->getmyKeyColumn() => $conditions];
960
        }
961
962
        $flexiData = $this->getFlexiData('', $conditions);
963
964
        if (!is_null($indexBy)) {
965
            $flexiData = $this->reindexArrayBy($flexiData);
966
        }
967
968
        return $flexiData;
969
    }
970
971
    /**
972
     * Vrací z FlexiBee sloupečky podle podmínek.