Association tables needed?

Is it common practice in phalcon that association-tables are always used for all types of database relations?

(I understand it is needed for M-M relations. For 1-M relations it could be left out, but I'm not sure if that would break the build-in function to for example retrieve data.)


you do not need association tables for 1-M relations. You can read more here:


@Nikolay I read these docs, but it only has examples using association tables. that is why I asked. The docs are not really clear about this.

edited Oct '15

@allox yes in the docs the example covers the 3 table scenario (

But you can simply use:

class Categories extends Model
    public $id;
    public $name;

    public function initialize()
        $this->hasMany("id", "Products", "category_id");

Where Products table has category_id and 1 category has many products.