本文整理匯總了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')));
}