本文整理汇总了PHP中SwatDB::executeStoredProcOne方法的典型用法代码示例。如果您正苦于以下问题:PHP SwatDB::executeStoredProcOne方法的具体用法?PHP SwatDB::executeStoredProcOne怎么用?PHP SwatDB::executeStoredProcOne使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SwatDB
的用法示例。
在下文中一共展示了SwatDB::executeStoredProcOne方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getArticleId
/**
* Gets an article id from the given article path
*
* @param string $path
*
* @return integer the database identifier corresponding to the given
* article path or null if no such identifier exists.
*/
protected function getArticleId($path)
{
// don't try to find articles with invalid UTF-8 in the path
if (!SwatString::validateUtf8($path)) {
require_once 'Site/exceptions/SitePathInvalidUtf8Exception.php';
throw new SitePathInvalidUtf8Exception(sprintf('Path is not valid UTF-8: ‘%s’', SwatString::escapeBinary($path)), 0, $path);
}
// don't try to find articles with more than 254 characters in the path
if (strlen($path) > 254) {
require_once 'Site/exceptions/SitePathTooLongException.php';
throw new SitePathTooLongException(sprintf('Path is too long: ‘%s’', $path));
}
$instance_id = $this->app->getInstanceId();
return SwatDB::executeStoredProcOne($this->app->db, 'findArticle', array($this->app->db->quote($path, 'text'), $this->app->db->quote($instance_id, 'integer')));
}