本文整理汇总了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']);
}
}