/** * Implementation of Jelly_Field_Behavior_Joinable * * @param Jelly_Builder $builder * @return void */ public function with($builder) { $join_col1 = $this->model . '.' . $this->column; // We use this field's alias rather than the foreign model so the join alias can be resolved $join_col2 = $this->name . '.' . $this->foreign['column']; $builder->join(array($this->foreign['model'], Jelly::join_alias($this)), 'LEFT')->on($join_col1, '=', $join_col2); }
/** * Implementation of Jelly_Field_Behavior_Joinable. * * @param Jelly_Builder $builder * @return void */ public function with($builder) { $builder->join(':' . $this->name, 'LEFT')->on($this->model . '.' . $this->name, '=', ':' . $this->name . '.' . $this->foreign['field']); }
/** * Implementation of Jelly_Field_Behavior_Joinable * * @param Jelly_Builder $builder * @return void */ public function with($builder) { $join_col1 = $this->model . '.:primary_key'; $join_col2 = $this->foreign['model'] . '.' . $this->foreign['column']; $builder->join(array($this->foreign['model'], $this->name), 'LEFT')->on($join_col1, '=', $join_col2); }