GBContent::reload PHP Method

reload() public method

public reload ( $data, $commits = null )
    function reload($data, $commits = null)
    {
        gb::event('will-reload-object', $this, $commits);
        $this->mimeType = GBMimeType::forFilename($this->name);
    }

Usage Example

Example #1
0
 function reload($data, $commits)
 {
     parent::reload($data, $commits);
     # apply info from commits, like publish date and author
     $this->applyInfoFromCommits($commits);
     # load actual comments
     $db = new GBCommentDB();
     $db->loadString($data);
     $this->comments = $db->get();
     # apply filters
     gb_cfilter::apply('post-reload-comments', $this);
 }