Code Duplication    Length = 13-14 lines in 2 locations

src/FlexiPeeHP/FlexiBeeRO.php 2 locations

@@ 722-734 (lines=13) @@
719
     *
720
     * @return int počet načtených položek
721
     */
722
    public function loadFromFlexiBee($id = null)
723
    {
724
        $data = [];
725
        if (is_null($id)) {
726
            $id = $this->getMyKey();
727
        }
728
729
        $flexidata = $this->getFlexiData(null, '/'.$id);
730
        if (count($flexidata) == 1) {
731
            $data = current($flexidata);
732
        }
733
        return $this->takeData($data);
734
    }
735
736
    /**
737
     * Převede data do Json formátu pro FlexiBee.
@@ 801-814 (lines=14) @@
798
     *                                     sloupečku
799
     * @return array
800
     */
801
    public function getAllFromFlexibee($conditions = null, $indexBy = null)
802
    {
803
        if (is_int($conditions)) {
804
            $conditions = [$this->getmyKeyColumn() => $conditions];
805
        }
806
807
        $flexiData = $this->getFlexiData('', $conditions);
808
809
        if (!is_null($indexBy)) {
810
            $flexiData = $this->reindexArrayBy($flexiData);
811
        }
812
813
        return $flexiData;
814
    }
815
816
    /**
817
     * Vrací z FlexiBee sloupečky podle podmínek.