Code Duplication    Length = 13-14 lines in 2 locations

src/FlexiPeeHP/FlexiBeeRO.php 2 locations

@@ 735-747 (lines=13) @@
732
     *
733
     * @return int počet načtených položek
734
     */
735
    public function loadFromFlexiBee($id = null)
736
    {
737
        $data = [];
738
        if (is_null($id)) {
739
            $id = $this->getMyKey();
740
        }
741
742
        $flexidata = $this->getFlexiData(null, '/'.$id);
743
        if (count($flexidata) == 1) {
744
            $data = current($flexidata);
745
        }
746
        return $this->takeData($data);
747
    }
748
749
    /**
750
     * Převede data do Json formátu pro FlexiBee.
@@ 822-835 (lines=14) @@
819
     *                                     sloupečku
820
     * @return array
821
     */
822
    public function getAllFromFlexibee($conditions = null, $indexBy = null)
823
    {
824
        if (is_int($conditions)) {
825
            $conditions = [$this->getmyKeyColumn() => $conditions];
826
        }
827
828
        $flexiData = $this->getFlexiData('', $conditions);
829
830
        if (!is_null($indexBy)) {
831
            $flexiData = $this->reindexArrayBy($flexiData);
832
        }
833
834
        return $flexiData;
835
    }
836
837
    /**
838
     * Vrací z FlexiBee sloupečky podle podmínek.