original_string: public function hasMany($model, $their_field = null, $our_field = null, $as_field = null)
      {
          if (!$our_field) {
              $our_field = $this->id_field;
          }
          if (!$their_field) {
              $their_field = ($this->table).'_id';
          }
          /** @type SQL_Many $rel */
          $rel = $this->add('SQL_Many', $as_field ?: $model);
          $rel->set($model, $their_field, $our_field);
  
          return $rel;
      }
code: public function hasMany($model, $their_field = null, $our_field = null, $as_field = null)
      {
          if (!$our_field) {
              $our_field = $this->id_field;
          }
          if (!$their_field) {
              $their_field = ($this->table).'_id';
          }
          /** @type SQL_Many $rel */
          $rel = $this->add('SQL_Many', $as_field ?: $model);
          $rel->set($model, $their_field, $our_field);
  
          return $rel;
      }
code_tokens: public function hasMany ( $ model , $ their_field = null , $ our_field = null , $ as_field = null ) { if ( ! $ our_field ) { $ our_field = $ this -> id_field ; } if ( ! $ their_field ) { $ their_field = ( $ this -> table ) . '_id' ; } /** @type SQL_Many $rel */ $ rel = $ this -> add ( 'SQL_Many' , $ as_field ? : $ model ) ; $ rel -> set ( $ model , $ their_field , $ our_field ) ; return $ rel ; }
docstring: Defines many to one association
docstring_tokens: Defines many to one association