Code Duplication    Length = 9-14 lines in 2 locations

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

@@ 3852-3865 (lines=14) @@
3849
     * @return bool {array; false} - Result array with fields or false.
3850
     * - Result array with fields or false.
3851
     */
3852
    public function getDocument($id = 0, $fields = '*', $published = 1, $deleted = 0)
3853
    {
3854
        if ($id == 0) {
3855
            return false;
3856
        } else {
3857
            $docs = $this->getDocuments(array($id), $published, $deleted, $fields, '', '', '', 1);
3858
3859
            if ($docs != false) {
3860
                return $docs[0];
3861
            } else {
3862
                return false;
3863
            }
3864
        }
3865
    }
3866
3867
    /**
3868
     * @param string $field
@@ 4675-4683 (lines=9) @@
4672
     *                        Default: 1
4673
     * @return bool
4674
     */
4675
    public function getTemplateVar($idname = "", $fields = "*", $docid = "", $published = 1)
4676
    {
4677
        if ($idname == "") {
4678
            return false;
4679
        } else {
4680
            $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "", ""); //remove sorting for speed
4681
            return ($result != false) ? $result[0] : false;
4682
        }
4683
    }
4684
4685
    /**
4686
     * getTemplateVars