Version: current

     1 <?php
     2
     3 /**
     4  * Simple form field shown when the NewsletterAdmin first loads.
     5  *
     6  * @package newsletter
     7  */
     8 class NewsletterList extends FormField {
     9     function __construct($name, $mailtype, $status = "Draft") {
    10         if(is_object($mailtype)) $this->mailType = $mailtype;
    11         else $this->mailType = DataObject::get_by_id('NewsletterType',$mailtype);
    12         $this->status = $status;
    13         parent::__construct(null);
    14     }
    15
    16     function FieldHolder() {
    17         return $this->renderWith("NewsletterList");
    18     }
    19
    20
    21     function setMailType($mailtype) {
    22         $this->mailType = $mailtype;
    23     }
    24
    25     function setController($controller) {
    26         $this->controller = $controller;
    27     }
    28     /* No longer used
    29     function Newsletters() {
    30         return DataObject::get( 'Newsletter', "`ParentID`='{$this->mailType->ID}' AND `Status`='{$this->status}'" );
    31     }
    32     */
    33
    34     function DraftNewsletters() {
    35         return $this->mailType->DraftNewsletters();
    36     }
    37
    38     function SentNewsletters() {
    39         return $this->mailType->SentNewsletters();
    40     }
    41
    42     function Status() {
    43         return $this->status;
    44     }
    45     function mailTypeID() {
    46         return $this->mailType->ID;
    47     }
    48 }
    49
    50 ?>

[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. -