Open CristianSitov opened 7 years ago
If I setup a relation like
public function hasClassificationType()
{
return $this->hasOne(ResourceClassificationType::class, HasClassificationType::class);
}
then I get the following error
Type error: Argument 1 passed to Sgpatil\Orientdb\Query\Builder::modelAsNode() must be of the type array or null, string given, called in /vendor/sgpatil/oriquent/src/Sgpatil/Orientdb/Eloquent/Relations/HasOne.php on line 69
The problem seems to be here:
// in Sgpatil/Orientdb/Eloquent/Relations/HasOne.php
$parentNode = $this->query->getQuery()->modelAsNode($this->parent->getTable());
while Query::modelAsNode() method says it only accepts arrays as seen here
/* @param array $labels
* @return string
*/
public function modelAsNode(array $labels = null) {
By running simple queries with Model::find() or Model::where() I'm obtaining a collection with entities only, without the related objects/vertices.
How can I run a query that can pull a specific "branch", for eg., Resource > HasClassificationType > ClassificationType and Resource > HasNote > Description, all together?