ActiveRecord\AbstractRelationship::build_association PHP 메소드

build_association() 공개 메소드

Creates a new instance of specified {@link Model} with the attributes pre-loaded.
public build_association ( activerecord\Model $model, array $attributes = [], $guard_attributes = true ) : activerecord\Model
$model activerecord\Model The model which holds this association
$attributes array Hash containing attributes to initialize the model with
리턴 activerecord\Model
    public function build_association(Model $model, $attributes = array(), $guard_attributes = true)
    {
        $class_name = $this->class_name;
        return new $class_name($attributes, $guard_attributes);
    }