Code Duplication    Length = 13-14 lines in 2 locations

src/FlexiPeeHP/FlexiBeeRO.php 2 locations

@@ 861-873 (lines=13) @@
858
     *
859
     * @return int počet načtených položek
860
     */
861
    public function loadFromFlexiBee($id = null)
862
    {
863
        $data = [];
864
        if (is_null($id)) {
865
            $id = $this->getMyKey();
866
        }
867
868
        $flexidata = $this->getFlexiData(null, '/'.$id);
869
        if (count($flexidata) == 1) {
870
            $data = current($flexidata);
871
        }
872
        return $this->takeData($data);
873
    }
874
875
    /**
876
     * Převede data do Json formátu pro FlexiBee.
@@ 948-961 (lines=14) @@
945
     *                                     sloupečku
946
     * @return array
947
     */
948
    public function getAllFromFlexibee($conditions = null, $indexBy = null)
949
    {
950
        if (is_int($conditions)) {
951
            $conditions = [$this->getmyKeyColumn() => $conditions];
952
        }
953
954
        $flexiData = $this->getFlexiData('', $conditions);
955
956
        if (!is_null($indexBy)) {
957
            $flexiData = $this->reindexArrayBy($flexiData);
958
        }
959
960
        return $flexiData;
961
    }
962
963
    /**
964
     * Vrací z FlexiBee sloupečky podle podmínek.