Code Duplication    Length = 9-14 lines in 2 locations

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

@@ 3829-3842 (lines=14) @@
3826
     * @return bool {array; false} - Result array with fields or false.
3827
     * - Result array with fields or false.
3828
     */
3829
    public function getDocument($id = 0, $fields = '*', $published = 1, $deleted = 0)
3830
    {
3831
        if ($id == 0) {
3832
            return false;
3833
        } else {
3834
            $docs = $this->getDocuments(array($id), $published, $deleted, $fields, '', '', '', 1);
3835
3836
            if ($docs != false) {
3837
                return $docs[0];
3838
            } else {
3839
                return false;
3840
            }
3841
        }
3842
    }
3843
3844
    /**
3845
     * @param string $field
@@ 4655-4663 (lines=9) @@
4652
     *                        Default: 1
4653
     * @return bool
4654
     */
4655
    public function getTemplateVar($idname = "", $fields = "*", $docid = "", $published = 1)
4656
    {
4657
        if ($idname == "") {
4658
            return false;
4659
        } else {
4660
            $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "", ""); //remove sorting for speed
4661
            return ($result != false) ? $result[0] : false;
4662
        }
4663
    }
4664
4665
    /**
4666
     * getTemplateVars