Pimcore\Model\Tool\Email\Log::getById PHP Method

getById() public static method

Returns the EmailLog entry by the given id
public static getById ( integer $id ) : EmailLog | null
$id integer
return EmailLog | null
    public static function getById($id)
    {
        $id = intval($id);
        if ($id < 1) {
            return null;
        }
        $emailLog = new Model\Tool\Email\Log();
        $emailLog->getDao()->getById($id);
        $emailLog->setEmailLogExistsHtml();
        $emailLog->setEmailLogExistsText();
        return $emailLog;
    }

Usage Example

Esempio n. 1
0
 /**
  * Loads a list of Email_Log for the specified parameters, returns an array of Email_Log elements
  *
  * @return array
  */
 public function load()
 {
     $emailLogs = $this->db->fetchCol("SELECT id FROM email_log" . $this->getCondition() . $this->getOrder() . $this->getOffsetLimit(), $this->model->getConditionVariables());
     $emailLogsArray = array();
     foreach ($emailLogs as $log) {
         $emailLogsArray[] = Model\Tool\Email\Log::getById($log);
     }
     $this->model->setEmailLogs($emailLogsArray);
     return $emailLogsArray;
 }
All Usage Examples Of Pimcore\Model\Tool\Email\Log::getById