Relationships
This commit is contained in:
@ -143,4 +143,10 @@ abstract class Model extends BaseModel implements ModelInterface {
|
||||
public function jsonSerialize() {
|
||||
return $this->toArray();
|
||||
}
|
||||
|
||||
public function setRelationship(string $class_name): Relationship {
|
||||
return (new Relationship)
|
||||
->setFactory($this->container->get('model'))
|
||||
->setStart($class_name);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user