i'm trying to get all relations from a model using this method:
$di->set('modelsManager', function() {
return new Phalcon\Mvc\Model\Manager();
});
On controller I've tried these variants and all of them are giving me an empty array.
$this->modelsManager->getRelations('Model');
$this->modelsManager->getRelations('/ns1/ns2/Model');
$this->modelsManager->getRelations('/ns1/ns2/Model');
In the documentation API the method looks like this:
public Phalcon\Mvc\Model\RelationInterface [] getRelations (string $modelName)
My model have this structure name: /ns1/ns2/Model
Is this a bug or I don't know how to use this method?
I found an alternative solution that works but is not beautiful:
$array1 = $this->modelsManager->getBelongsTo(new \ns1\ns2\Model());
$array2 = $this->modelsManager->getHasOneAndHasMany(new \ns1\ns2\Model());
array_merge($array1, $array2);