Exemplo n.º 1
0
 public function setup()
 {
     if (!$this->target_model) {
         $this->target_model = Inflections::camelize($this->field, true);
     }
     // Overrides naming of field to model_id if col_name is not explicitly set
     if (!$this->col_name) {
         $this->col_name = Inflections::underscore($this->target_model) . "_id";
     }
 }
Exemplo n.º 2
0
 public function setup()
 {
     $this->col_name = false;
     $class_name = get_class($this->model);
     if (!$this->target_model) {
         $this->target_model = Inflections::camelize($this->field, true);
     }
     if (!$this->join_field) {
         $this->join_field = Inflections::underscore($class_name) . "_" . $this->model->primary_key;
     }
 }