Jump to:

3373 Posts in 998 Topics by 712 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Notice framework/dev/deprecation php Page,Holder class

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 409 Views
  • jelavuk
    Avatar
    Community Member
    1 Post

    Notice framework/dev/deprecation php Page,Holder class Link to this post

    hello,
    i have the problem.
    I created classes CompanyPage,CompanyHolder and ss template.
    When I tried to create CompanyPage(after created companyholder) appear notice Notice framework/dev/deprecation.php.
    Where i'm wrong?

    <?php

    /**
    * Defines the CompanyPage page type
    */
    class CompanyPage extends Page {
    static $db = array(
          'Company_name' => 'Text',
          'Email' => 'Text',
          'Adress' => 'Text',
          'Phone_number' => 'Text'
          
    );
    static $default_parent = 'CompanyHolder';
    //static $has_one = array();

       public static $has_one = array(
       );

    function getCMSFields() {
    $fields = parent::getCMSFields();

    $fields->addFieldToTab('Root.Content.Main', new TextField('Company_name'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new TextField('Email'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new TextField('Adress'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new TextField('Phone_number'), 'Content');
        //$fields->addFieldToTab('Root.Content.Main', new DateField('DateCreated'), 'Content');
        // $fields->addFieldToTab('Root.Content.Main', new DateField('DateLogin'), 'Content');
       //$this->extend('updateCMSFields', $fields);
    return $fields;
    }
    }

    class CompanyPage_Controller extends Page_Controller {

    }

    ?>
    <?php

    /**

    */
    class CompanyHolder extends Page {
    public static $db = array(
       );

       public static $has_one = array(
       );
    static $allowed_children = array(
          'CompanyPage'
       );
    }

    class CompanyHolder_Controller extends Page_Controller {

    }

    ?>

    CompanyHolder.ss:
    <div class="content-container unit size3of4 lastUnit">
       <article>
          <h1>$Title</h1>
          <div class="content">$Content</div>
       </article>
             <% loop Children %>
          $Company_name
             
          
       <% end_loop %>
          
          
          
    </div>

    companPage.ss:
    $Content

  • martimiz
    Avatar
    Forum Moderator
    1038 Posts

    Re: Notice framework/dev/deprecation php Page,Holder class Link to this post

    A deprecation notice in SilverStripe usually means that some function in your code should either no longer be used in the current version of SilverStripe, or a function/property definition has changed (public added to it, or an extra parameter) and you should change your subclassed version accordingly.

    This of course depends on the SilverStripe version you have installed, and the (custom) code you are using. The deprecation notice should tell you more about the affected code, so you can look up the equivalent from the parent class. If this doesn't make it clear, you could post the complete deprecation message here.

    409 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.