Merge branch 'develop'

This commit is contained in:
2020-03-02 12:20:57 -03:00

View File

@ -144,9 +144,11 @@ abstract class Model extends BaseModel implements ModelInterface {
return $this->toArray();
}
public function setRelationship(string $class_name): Relationship {
public function setRelationship(string $class_name, string $relation_key, string $self_key): Relationship {
return (new Relationship)
->setFactory($this->container->get('model'))
->setStart($class_name);
->setStart($class_name)
->with($class_name, $relation_key, get_called_class(), $self_key)
->setCondition(get_called_class(), $self_key, $this->$self_key);
}
}