ActiveRecord\HasMany::__construct PHP Method

__construct() public method

Constructs a {@link HasMany} relationship.
public __construct ( array $options = [] ) : HasMany
$options array Options for the association
return HasMany
    public function __construct($options = array())
    {
        parent::__construct($options);
        if (isset($this->options['through'])) {
            $this->through = $this->options['through'];
            if (isset($this->options['source'])) {
                $this->set_class_name($this->options['source']);
            }
        }
        if (!$this->primary_key && isset($this->options['primary_key'])) {
            $this->primary_key = is_array($this->options['primary_key']) ? $this->options['primary_key'] : array($this->options['primary_key']);
        }
        if (!$this->class_name) {
            $this->set_inferred_class_name();
        }
    }