API:getSnippetId

From MODx Wiki

Jump to: navigation, search

Source Code

File: manager/includes/document.parser.class.inc.php
Line: 1483
function getSnippetId() {
        if ($this->currentSnippet) {
            $tbl= $this->getFullTableName("site_snippets");
            $rs= $this->dbQuery("SELECT id FROM $tbl WHERE name='" . mysql_escape_string($this->currentSnippet) . "' LIMIT 1");
            $row= @ $this->fetchRow($rs);
            if ($row['id'])
                return $row['id'];
        }
        return 0;
    }
Personal tools