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
@@ 4690-4698 (lines=9) @@
4687
     *                        Default: 1
4688
     * @return bool
4689
     */
4690
    public function getTemplateVar($idname = "", $fields = "*", $docid = "", $published = 1)
4691
    {
4692
        if ($idname == "") {
4693
            return false;
4694
        } else {
4695
            $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "", ""); //remove sorting for speed
4696
            return ($result != false) ? $result[0] : false;
4697
        }
4698
    }
4699
4700
    /**
4701
     * getTemplateVars