FIX: Sub arrays
This commit is contained in:
@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Aldarien\Common\Factory;
|
namespace Aldarien\Common\Factory;
|
||||||
|
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface as Container;
|
||||||
use \ORM as ORM;
|
use \ORM as ORM;
|
||||||
use \Model as BaseFactory;
|
use \Model as BaseFactory;
|
||||||
|
|
||||||
class Model {
|
class Model {
|
||||||
protected $container;
|
protected $container;
|
||||||
public function __construct(ContainerInterface $container) {
|
public function __construct(Container $container) {
|
||||||
$this->container = $container;
|
$this->container = $container;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class RelationNode {
|
|||||||
$source = implode('.', [$this->source->table, $this->source->key]);
|
$source = implode('.', [$this->source->table, $this->source->key]);
|
||||||
$destination = implode('.', [$this->destination->table, $this->destination->key]);
|
$destination = implode('.', [$this->destination->table, $this->destination->key]);
|
||||||
$method = str_replace([' '], ['_'], strtolower($this->join));
|
$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;
|
return $output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,13 +46,13 @@ class Relationship {
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
public function build(): ModelFactory {
|
public function build(): ModelFactory {
|
||||||
$output = $factory->find($this->start->class);
|
$output = $this->factory->find($this->start->class);
|
||||||
foreach ($this->nodes as $node) {
|
foreach ($this->nodes as $node) {
|
||||||
$output = $node->build($output);
|
$output = $node->build($output);
|
||||||
}
|
}
|
||||||
$output = $output->where([
|
$output = $output->where([
|
||||||
implode('.', [$this->condition->table, $this->condition->key]),
|
[implode('.', [$this->condition->table, $this->condition->key]),
|
||||||
$this->condition->value
|
$this->condition->value]
|
||||||
]);
|
]);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user