Code Duplication    Length = 9-14 lines in 2 locations

manager/includes/src/Core.php 2 locations

@@ 4150-4163 (lines=14) @@
4147
     * @return bool {array; false} - Result array with fields or false.
4148
     * - Result array with fields or false.
4149
     */
4150
    public function getDocument($id = 0, $fields = '*', $published = 1, $deleted = 0)
4151
    {
4152
        if ($id == 0) {
4153
            return false;
4154
        } else {
4155
            $docs = $this->getDocuments(array($id), $published, $deleted, $fields, '', '', '', 1);
4156
4157
            if ($docs != false) {
4158
                return $docs[0];
4159
            } else {
4160
                return false;
4161
            }
4162
        }
4163
    }
4164
4165
    /**
4166
     * @param string $field
@@ 4982-4990 (lines=9) @@
4979
     *                        Default: 1
4980
     * @return bool
4981
     */
4982
    public function getTemplateVar($idname = "", $fields = "*", $docid = "", $published = 1)
4983
    {
4984
        if ($idname == "") {
4985
            return false;
4986
        } else {
4987
            $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "", ""); //remove sorting for speed
4988
            return ($result != false) ? $result[0] : false;
4989
        }
4990
    }
4991
4992
    /**
4993
     * getTemplateVars