本文整理汇总了PHP中Oro\Bundle\EmailBundle\Entity\Email::setSentAt方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::setSentAt方法的具体用法?PHP Email::setSentAt怎么用?PHP Email::setSentAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oro\Bundle\EmailBundle\Entity\Email
的用法示例。
在下文中一共展示了Email::setSentAt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSentAtGetterAndSetter
public function testSentAtGetterAndSetter()
{
$entity = new Email();
$date = new \DateTime('now', new \DateTimeZone('UTC'));
$entity->setSentAt($date);
$this->assertEquals($date, $entity->getSentAt());
}
示例2: testGetDate
public function testGetDate()
{
$email = new Email();
$date = new \DateTime('now', new \DateTimeZone('UTC'));
$email->setSentAt($date);
$this->assertSame($date, $this->provider->getDate($email));
}
示例3: inapplicableEmailsProvider
public function inapplicableEmailsProvider()
{
$date = new \DateTime('now', new \DateTimeZone('UTC'));
$oldEmailDate = new \DateTime('now', new \DateTimeZone('UTC'));
$oldEmailDate->sub(\DateInterval::createFromDateString('2 day'));
$applicableSubjectsAndBodies = [['not empty subject', 'This is email body with offer, sale and won words.', $date], [null, 'This email has nothing.', $date], [null, 'This is email body with sale and won words.', $oldEmailDate]];
$data = array_map(function ($subjectAndBody) {
list($subject, $bodyContent, $sentAt) = $subjectAndBody;
$body = new EmailBody();
$body->setBodyContent($bodyContent);
$email = new Email();
$email->setSubject($subject);
$email->setEmailBody($body);
$email->setSentAt($sentAt);
return [$email];
}, $applicableSubjectsAndBodies);
return $data;
}