Code Duplication    Length = 9-14 lines in 2 locations

manager/includes/document.parser.class.inc.php 2 locations

@@ 3872-3885 (lines=14) @@
3869
     * @return bool {array; false} - Result array with fields or false.
3870
     * - Result array with fields or false.
3871
     */
3872
    public function getDocument($id = 0, $fields = '*', $published = 1, $deleted = 0)
3873
    {
3874
        if ($id == 0) {
3875
            return false;
3876
        } else {
3877
            $docs = $this->getDocuments(array($id), $published, $deleted, $fields, '', '', '', 1);
3878
3879
            if ($docs != false) {
3880
                return $docs[0];
3881
            } else {
3882
                return false;
3883
            }
3884
        }
3885
    }
3886
3887
    /**
3888
     * @param string $field
@@ 4695-4703 (lines=9) @@
4692
     *                        Default: 1
4693
     * @return bool
4694
     */
4695
    public function getTemplateVar($idname = "", $fields = "*", $docid = "", $published = 1)
4696
    {
4697
        if ($idname == "") {
4698
            return false;
4699
        } else {
4700
            $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "", ""); //remove sorting for speed
4701
            return ($result != false) ? $result[0] : false;
4702
        }
4703
    }
4704
4705
    /**
4706
     * getTemplateVars