Models

Get started

You can create a new model with the Walrus CLI, or create it yourself using this basic syntax:

    namespace engine\models;

    use R;

    class Test extends WalrusModel
    {

    }

Don't forget than Walrus use the RedBean ORM by default.

Call a method from an other model

To call a method from an other model, use the model method:

    public function run()
    {
        $this->model('test')->methodOfTestModel();
    }

The model method return the model class so you can directly call method from it