Code Duplication    Length = 13-14 lines in 2 locations

src/FlexiPeeHP/FlexiBeeRO.php 2 locations

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