Jump to:

3430 Posts in 1057 Topics by 734 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: 472 Views
  • jelavuk
    Community Member
    1 Post

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

    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?


    * 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 {




    class CompanyHolder extends Page {
    public static $db = array(

       public static $has_one = array(
    static $allowed_children = array(

    class CompanyHolder_Controller extends Page_Controller {



    <div class="content-container unit size3of4 lastUnit">
          <div class="content">$Content</div>
             <% loop Children %>
       <% end_loop %>


  • martimiz
    Forum Moderator
    1067 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.

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.