本文整理汇总了PHP中APP::getInstanceModel方法的典型用法代码示例。如果您正苦于以下问题:PHP APP::getInstanceModel方法的具体用法?PHP APP::getInstanceModel怎么用?PHP APP::getInstanceModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类APP
的用法示例。
在下文中一共展示了APP::getInstanceModel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
function check()
{
if (!$this->Email) {
throw new Exception('Informe o e-mail.');
} else {
if (!$this->getEmail()) {
throw new Exception('E-mail inválido.');
} else {
if ($busca = APP::getInstanceModel('Emails')->Lista('WHERE a.id != :id AND a.email = :email AND a.ref = :ref AND a.status != 99 LIMIT 1', ['id' => $this->getId(), 'email' => $this->getEmail(), 'ref' => $this->getRef()])) {
if ($busca[0]->getStatus() == 99) {
$this->getId($busca[0]->getId());
$this->setStatus(1);
} else {
throw new Exception('E-mail já está cadastrado.');
}
}
}
}
}
示例2: imgList
/**
*
* @param boolean $Default
* @param string $ADDReference
* @return array|ImageVO
*/
function imgList($Default = false, $ADDReference = null)
{
return APP::getInstanceModel('ImagensModel')->getByRef($this->getTable() . (string) $ADDReference, $this->getId(), $Default);
}
示例3: newModel
/**
*
* @param string $ModelName
* @return Model
*/
function newModel($ModelName)
{
return APP::getInstanceModel(ucfirst($ModelName));
}
示例4: getConfig
/**
* Retorna as configurações de envio
* @return SmtpVO
* @throws Exception
*/
function getConfig()
{
if (!$this->Config) {
$this->Config = APP::getInstanceModel('Smtp')->getConfig();
if (empty($this->Config)) {
throw new Exception('Não foi possível carregar as configurações SMTP.');
}
$this->SMTP->IsSMTP();
$this->SMTP->IsHTML();
$this->SMTP->CharSet = 'UTF-8';
$this->SMTP->Host = $this->Config->getHost();
$this->SMTP->Username = $this->Config->getLogin();
$this->SMTP->Password = $this->Config->getSenha();
$this->SMTP->Port = $this->Config->getPorta();
$this->SMTP->SMTPAuth = $this->Config->getAutenticar() ? true : false;
$this->SMTP->SMTPSecure = $this->Config->getProtocolo();
$this->SMTP->Subject = $this->Config->getAssunto();
$this->setFrom($this->Config->getNome(), $this->Config->getEmail());
}
return $this->Config;
}