Code Duplication    Length = 13-14 lines in 2 locations

src/FlexiPeeHP/FlexiBeeRO.php 2 locations

@@ 841-853 (lines=13) @@
838
     *
839
     * @return int počet načtených položek
840
     */
841
    public function loadFromFlexiBee($id = null)
842
    {
843
        $data = [];
844
        if (is_null($id)) {
845
            $id = $this->getMyKey();
846
        }
847
848
        $flexidata = $this->getFlexiData(null, '/'.$id);
849
        if (count($flexidata) == 1) {
850
            $data = current($flexidata);
851
        }
852
        return $this->takeData($data);
853
    }
854
855
    /**
856
     * Převede data do Json formátu pro FlexiBee.
@@ 928-941 (lines=14) @@
925
     *                                     sloupečku
926
     * @return array
927
     */
928
    public function getAllFromFlexibee($conditions = null, $indexBy = null)
929
    {
930
        if (is_int($conditions)) {
931
            $conditions = [$this->getmyKeyColumn() => $conditions];
932
        }
933
934
        $flexiData = $this->getFlexiData('', $conditions);
935
936
        if (!is_null($indexBy)) {
937
            $flexiData = $this->reindexArrayBy($flexiData);
938
        }
939
940
        return $flexiData;
941
    }
942
943
    /**
944
     * Vrací z FlexiBee sloupečky podle podmínek.