当前位置: 首页>>代码示例>>PHP>>正文


PHP Newsletter::whetherNewsletterIDExists方法代码示例

本文整理汇总了PHP中Newsletter::whetherNewsletterIDExists方法的典型用法代码示例。如果您正苦于以下问题:PHP Newsletter::whetherNewsletterIDExists方法的具体用法?PHP Newsletter::whetherNewsletterIDExists怎么用?PHP Newsletter::whetherNewsletterIDExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Newsletter的用法示例。


在下文中一共展示了Newsletter::whetherNewsletterIDExists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testWhetherNewsletterExists

 public function testWhetherNewsletterExists()
 {
     global $wpdb;
     $whetherNewsletterExists = Newsletter::whetherNewsletterIDExists(9801);
     $this->assertFalse($whetherNewsletterExists);
     $newsletter = array("name" => md5(microtime()), "reply_to" => 'flarecore@' . md5(microtime()) . '.com', "fromname" => 'Test', "fromemail" => 'flare@' . md5(microtime()) . '.com');
     $addNewsletterQuery = sprintf("INSERT INTO %swpr_newsletters (`name`, `reply_to`, `fromname`, `fromemail`) VALUES ('%s','%s', '%s', '%s')", $wpdb->prefix, $newsletter['name'], $newsletter['reply_to'], $newsletter['fromname'], $newsletter['fromemail']);
     $wpdb->query($addNewsletterQuery);
     $newsletter_id = $wpdb->insert_id;
     $this->assertTrue(Newsletter::whetherNewsletterIDExists($newsletter_id));
 }
开发者ID:anirut,项目名称:wp-autoresponder,代码行数:11,代码来源:NewslettersModelTest.php

示例2: validateAddFormPostData

 public static function validateAddFormPostData($post_data, &$errors)
 {
     $name = $post_data['name'];
     if (!Autoresponder::whetherValidAutoresponderName(array('name' => $name))) {
         $errors[] = __("The name for the autoresponder you've entered is invalid");
     }
     if (!Newsletter::whetherNewsletterIDExists($post_data['nid'])) {
         $errors[] = __("The newsletter you've selected doesn't exist");
         return $errors;
     }
 }
开发者ID:anirut,项目名称:wp-autoresponder,代码行数:11,代码来源:autoresponder.php

示例3: addAutoresponder

 public static function addAutoresponder($nid, $name)
 {
     global $wpdb;
     if (!Newsletter::whetherNewsletterIDExists($nid)) {
         throw new NonExistentNewsletterAutoresponderAdditionException();
     }
     if (!Autoresponder::whetherValidAutoresponderName(array("nid" => $nid, "name" => $name))) {
         throw new InvalidArgumentException("Invalid autoresponder arguments");
     }
     $createAutoresponderQuery = sprintf("INSERT INTO `{$wpdb->prefix}wpr_autoresponders` (`nid`, `name`) VALUES (%d, '%s');", $nid, $name);
     $wpdb->query($createAutoresponderQuery);
     $autoresponder_id = $wpdb->insert_id;
     return new Autoresponder($autoresponder_id);
 }
开发者ID:anirut,项目名称:wp-autoresponder,代码行数:14,代码来源:autoresponder.php

示例4: getSubscribersOfNewsletter

 public static function getSubscribersOfNewsletter($nid)
 {
     if (false == Newsletter::whetherNewsletterIDExists($nid)) {
         throw new NewsletterNotFoundException();
     }
     throw new BadMethodCallException("Subscribers of newsletter get yet to be implemented   ");
 }
开发者ID:anirut,项目名称:wp-autoresponder,代码行数:7,代码来源:subscriber.php


注:本文中的Newsletter::whetherNewsletterIDExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。