Objects

Now that you have the objects, there is a lot of nice things that you can do with it.

First, you can use this as a cheat sheet for all the default properties and Methods from the objects. Make good use of it!

Relationships

Here you can create a new relation for the object.
On the opposite of programmers, tables and objects do have relations.
If you don't know how objects and relations between them work, then I recommend you to study about it. =P

You can create relations:
belongs to
The object belongs to another.
You will select the field from your object that will be equivalent to the id of the relational object.
For this kind of relation, you can Lazy Load and Auto Load the object.
This relation will also generate a new property with the name of the related object and method (for getting it automatically).
has many
The object will have multiple of the other objects.
You will select the field from the other object that will be equivalent to the id of your object.
For this kind of relation, you can Lazy Load and Auto Load the object.
This relation will also generate a new property with the name of the related object and method (for getting it automatically).
has and belongs to many
The object will have multiple of the other objects.
You will select the field from the other object that will be equivalent to the id of your object.
For this kind of relation, you can Lazy Load and Auto Load the object.
This relation will also generate a new property with the name of the related object and method (for getting it automatically).

Lazy load

When an object has lazy load, it can be automatically loaded only when it is required.
It's beautiful. It's the future.
You load the object. Only it. Then you need an object that is related. You just call the object and Magrathea will get it from the database automatically and give it back to you.
Easy as that.

Auto load

This is even better:
Let's suppose you have an object that you only uses it with something relational to it.
You can select the Auto load option and Magrathea will build a query with a join clause, that will always load everything together.
This is magic.

Code

We are trying to be as transparent as possible here.
That's why we show you the code that is generated for each object.
Yes! That's right! Magrathea rights some codes to you.
That's what you should see next: Generate Code.