Webylon 3.1 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • auth
  • Booking
  • cart
    • shipping
    • steppedcheckout
  • Catalog
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • BatchProcess
  • BatchProcess_Controller
  • BouncedList
  • Newsletter
  • Newsletter_Email
  • Newsletter_Recipient
  • Newsletter_SentRecipient
  • NewsletterAdmin
  • NewsletterEmailProcess
  • NewsletterList
  • NewsletterRole
  • NewsletterType
  • ProgressBar
  • RecipientExportField
  • RecipientImportField
  • RecipientImportField_Cell
  • SubscribeForm
  • SubscribeForm_Controller
  • Unsubscribe_Controller
  • Unsubscribe_MailingListForm
  • UnsubscribedList
  • UnsubscribeRecord
 1 <?php
 2 
 3 /**
 4  * Displays a list of all members that have unsubscribed from the list
 5  *
 6  * @package newsletter
 7  */
 8 class UnsubscribedList extends FormField {
 9 
10     protected $nlType;
11 
12     function __construct( $name, $newsletterType ) {
13         parent::__construct( $name, '', null );
14 
15         if( is_object( $newsletterType ) )
16             $this->nlType = $newsletterType;
17         else
18             $this->nlType = DataObject::get_by_id( 'NewsletterType', $newsletterType );
19     }
20 
21     function FieldHolder() {
22         return $this->renderWith( 'NewsletterAdmin_UnsubscribedList' );
23     }
24 
25     function Entries() {
26 
27         $id = $this->nlType->ID;
28 
29         if(defined('DB::USE_ANSI_SQL')) {
30             $unsubscribeRecords = DataObject::get('UnsubscribeRecord', "\"NewsletterTypeID\"='$id'" );
31         } else {
32             $unsubscribeRecords = DataObject::get('UnsubscribeRecord', "`NewsletterTypeID`='$id'" );
33         }
34 
35 
36         // user_error($id, E_USER_ERROR );
37 
38         if( !$unsubscribeRecords )
39             return null;
40 
41         foreach( $unsubscribeRecords as $unsubscribeRecord ) {
42             if( $unsubscribeRecord ) {
43                 $unsubscribedUsers[] = new ArrayData( array(
44                     'Record' => $unsubscribeRecord,
45                     'Member' => DataObject::get_by_id( 'Member', $unsubscribeRecord->MemberID )
46                 ));
47             }
48         }
49 
50         return new DataObjectSet( $unsubscribedUsers );
51     }
52 
53     function setController($controller) {
54         $this->controller = $controller;
55     }
56 }
57 ?>
58 
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.1 API Docs API documentation generated by ApiGen 2.8.0