ActiveRecord\Table::get_relationship PHP Method

get_relationship() public method

Retrieve a relationship object for this table. Strict as true will throw an error if the relationship name does not exist.
public get_relationship ( $name, $strict = false ) : activerecord\HasOne | HasMany | BelongsTo
$name string name of Relationship
$strict bool
return activerecord\HasOne | HasMany | BelongsTo Relationship or null
    public function get_relationship($name, $strict = false)
    {
        if ($this->has_relationship($name)) {
            return $this->relationships[$name];
        }
        if ($strict) {
            throw new RelationshipException("Relationship named {$name} has not been declared for class: {$this->class->getName()}");
        }
        return null;
    }