FIX: Sub arrays

This commit is contained in:
2020-03-10 13:48:02 -03:00
parent 01fdb56b54
commit 8a3aceecf4
3 changed files with 6 additions and 6 deletions

View File

@ -1,13 +1,13 @@
<?php
namespace Aldarien\Common\Factory;
use Psr\Container\ContainerInterface;
use Psr\Container\ContainerInterface as Container;
use \ORM as ORM;
use \Model as BaseFactory;
class Model {
protected $container;
public function __construct(ContainerInterface $container) {
public function __construct(Container $container) {
$this->container = $container;
}

View File

@ -48,7 +48,7 @@ class RelationNode {
$source = implode('.', [$this->source->table, $this->source->key]);
$destination = implode('.', [$this->destination->table, $this->destination->key]);
$method = str_replace([' '], ['_'], strtolower($this->join));
$output = $factory->{$method}([$this->destination->table, [$destination, $source, $this->relation]]);
$output = $factory->{$method}([[$this->destination->table, $destination, $source, $this->relation]]);
return $output;
}
}

View File

@ -46,13 +46,13 @@ class Relationship {
return $this;
}
public function build(): ModelFactory {
$output = $factory->find($this->start->class);
$output = $this->factory->find($this->start->class);
foreach ($this->nodes as $node) {
$output = $node->build($output);
}
$output = $output->where([
implode('.', [$this->condition->table, $this->condition->key]),
$this->condition->value
[implode('.', [$this->condition->table, $this->condition->key]),
$this->condition->value]
]);
return $output;
}