本文整理匯總了PHP中Conexao::alertaEnviaEmail方法的典型用法代碼示例。如果您正苦於以下問題:PHP Conexao::alertaEnviaEmail方法的具體用法?PHP Conexao::alertaEnviaEmail怎麽用?PHP Conexao::alertaEnviaEmail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Conexao
的用法示例。
在下文中一共展示了Conexao::alertaEnviaEmail方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: count
public function count($condicao = "")
{
try {
if (!empty($condicao)) {
$query = 'SELECT COUNT(*) AS total FROM ' . self::$tabela . ' WHERE excluido = 0 AND ' . $condicao;
} else {
$query = 'SELECT COUNT(*) AS total FROM ' . self::$tabela . ' WHERE excluido = 0';
}
$result = $this->conexao->prepare($query);
$result->execute();
$resultado = $result->fetch(PDO::FETCH_ASSOC);
return $resultado['total'];
} catch (PDOException $e) {
Conexao::alertaEnviaEmail("<code>" . $e->getMessage() . "</code>", $_SERVER['SCRIPT_NAME']);
}
}
示例2: selecionarPorId
protected function selecionarPorId($model, $id)
{
try {
$result = $this->conexao->prepare("SELECT *\n\t\t\t\t\t\t\t\t\t\t \t FROM " . $model::$tabela . "\n\t\t\t\t\t\t\t\t\t\t \t WHERE id = :id");
$result->bindParam(':id', $id, PDO::PARAM_INT);
$result->execute();
$linha = $result->fetch(PDO::FETCH_ASSOC);
$arrayModel = get_object_vars($model);
foreach ($arrayModel as $indice => $valor) {
if (!in_array($indice, array('tabela', 'conexao'))) {
$model->{$indice} = $linha[$indice];
}
}
} catch (PDOException $e) {
Conexao::alertaEnviaEmail("<code>" . $e->getMessage() . "</code>", $_SERVER['SCRIPT_NAME']);
}
}