Code Duplication    Length = 9-14 lines in 2 locations

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

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