Code Duplication    Length = 9-14 lines in 2 locations

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

@@ 3995-4008 (lines=14) @@
3992
     * @return bool {array; false} - Result array with fields or false.
3993
     * - Result array with fields or false.
3994
     */
3995
    public function getDocument($id = 0, $fields = '*', $published = 1, $deleted = 0)
3996
    {
3997
        if ($id == 0) {
3998
            return false;
3999
        } else {
4000
            $docs = $this->getDocuments(array($id), $published, $deleted, $fields, '', '', '', 1);
4001
4002
            if ($docs != false) {
4003
                return $docs[0];
4004
            } else {
4005
                return false;
4006
            }
4007
        }
4008
    }
4009
4010
    /**
4011
     * @param string $field
@@ 4853-4861 (lines=9) @@
4850
     *                        Default: 1
4851
     * @return bool
4852
     */
4853
    public function getTemplateVar($idname = "", $fields = "*", $docid = "", $published = 1)
4854
    {
4855
        if ($idname == "") {
4856
            return false;
4857
        } else {
4858
            $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "",
4859
                ""); //remove sorting for speed
4860
4861
            return ($result != false) ? $result[0] : false;
4862
        }
4863
    }
4864