2014-12-09 17:25:39 -04:00
|
|
|
<?php
|
2018-08-27 12:16:11 -04:00
|
|
|
|
2014-12-09 17:25:39 -04:00
|
|
|
class EmailServer extends BaseEmailServer
|
|
|
|
|
{
|
2018-08-27 12:16:11 -04:00
|
|
|
/**
|
|
|
|
|
* Load the default account
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function loadDefaultAccount()
|
|
|
|
|
{
|
|
|
|
|
$c = new Criteria('workflow');
|
|
|
|
|
$c->clearSelectColumns();
|
|
|
|
|
$c->addSelectColumn(EmailServerPeer::MESS_ACCOUNT);
|
|
|
|
|
$c->add(EmailServerPeer::MESS_DEFAULT, 1);
|
|
|
|
|
$rs = EmailServerPeer::doSelectRS($c, Propel::getDBConnection('workflow_ro'));
|
|
|
|
|
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
|
|
|
$rs->next();
|
|
|
|
|
$response = $rs->getRow();
|
2015-11-11 11:31:25 -04:00
|
|
|
|
2018-08-27 12:16:11 -04:00
|
|
|
return $response;
|
|
|
|
|
}
|
2015-11-11 11:31:25 -04:00
|
|
|
|
2018-08-27 12:16:11 -04:00
|
|
|
/**
|
|
|
|
|
* Check if the MESS_UID exist
|
|
|
|
|
*
|
|
|
|
|
* @param string $emailServerUid
|
|
|
|
|
*
|
|
|
|
|
* @return boolean
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
public static function exists($emailServerUid)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$criteria = new Criteria('workflow');
|
|
|
|
|
$criteria->add(EmailServerPeer::MESS_UID, $emailServerUid, Criteria::EQUAL);
|
|
|
|
|
$dataset = EmailServerPeer::doSelectOne($criteria);
|
2015-11-11 11:31:25 -04:00
|
|
|
|
2018-08-27 12:16:11 -04:00
|
|
|
return !is_null($dataset);
|
2015-11-11 11:31:25 -04:00
|
|
|
|
2018-08-27 12:16:11 -04:00
|
|
|
} catch (Exception $e) {
|
|
|
|
|
throw $e;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-12-09 17:25:39 -04:00
|
|
|
}
|
|
|
|
|
|