Hi,
Is there anyway to get all the relationship of a model. I know there is a thread here
But this is somehow null in every case.
Any direction here will be very helpful.
Thanks alot.
Hi,
Is there anyway to get all the relationship of a model. I know there is a thread here
But this is somehow null in every case.
Any direction here will be very helpful.
Thanks alot.
The Rain model has a getRelationDefinitions()
method that does exactly that.
foreach ($model->getRelationDefinitions() as $type => $relations) {
foreach ($relations as $relation => $config) {
$model->load($relation);
}
}