Example #1
0
 /**
  * Automatically sets foreign to sensible defaults.
  *
  * @param   string  $model
  * @param   string  $name
  * @return  void
  */
 public function initialize(Jam_Meta $meta, $name)
 {
     parent::initialize($meta, $name);
     if (!$this->join_table) {
         $this->join_table = Jam_Association_Collection::guess_through_table($this->foreign_model, $this->model);
     }
     if (!$this->foreign_key) {
         $this->foreign_key = $this->model . '_id';
     }
     if ($this->join_table_paranoid === TRUE) {
         $this->join_table_paranoid = 'is_deleted';
     }
     if (!$this->association_foreign_key) {
         $this->association_foreign_key = $this->foreign_model . '_id';
     }
 }