FIX: Sub arrays
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user