setModel() public static method

Set the model for the given post type.
public static setModel ( string $type, string $model ) : void
$type string The post type.
$model string The class name of the model for that type.
return void
Esempio n. 1
0
 public function registerPostTypes()
 {
     $models = ['Flarum\\Core\\Post\\CommentPost', 'Flarum\\Core\\Post\\DiscussionRenamedPost'];
     $this->app->make('events')->fire(new ConfigurePostTypes($models));
     foreach ($models as $model) {
         Post::setModel($model::$type, $model);
     }
 }