本文整理汇总了PHP中Exception::getSQLState方法的典型用法代码示例。如果您正苦于以下问题:PHP Exception::getSQLState方法的具体用法?PHP Exception::getSQLState怎么用?PHP Exception::getSQLState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exception
的用法示例。
在下文中一共展示了Exception::getSQLState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleException
/**
* Handles Exceptions. Suppresses exceptions caused by missing structures.
*
* @param Exception $exception
*
* @return void
*
* @throws Exception
*/
private function handleException(Exception $exception)
{
if (!$this->writer->sqlStateIn($exception->getSQLState(), array(RedBean_QueryWriter::C_SQLSTATE_NO_SUCH_TABLE, RedBean_QueryWriter::C_SQLSTATE_NO_SUCH_COLUMN))) {
throw $exception;
}
}
示例2: handleException
/**
* Handles exceptions. Suppresses exceptions caused by missing structures.
*
* @param Exception $exception exception to handle
*
* @return void
*/
private function handleException(\Exception $exception)
{
if ($this->oodb->isFrozen() || !$this->writer->sqlStateIn($exception->getSQLState(), array(QueryWriter::C_SQLSTATE_NO_SUCH_TABLE, QueryWriter::C_SQLSTATE_NO_SUCH_COLUMN))) {
throw $exception;
}
}
示例3: handleException
/**
* Handles exceptions. Suppresses exceptions caused by missing structures.
*
* @param Exception $exception exception
*
* @return void
*/
protected function handleException(\Exception $exception)
{
if (!$this->writer->sqlStateIn($exception->getSQLState(), array(QueryWriter::C_SQLSTATE_NO_SUCH_TABLE, QueryWriter::C_SQLSTATE_NO_SUCH_COLUMN))) {
throw $exception;
}
}