8 Commits

Author SHA1 Message Date
af801e769f Merge branch 'develop' 2020-07-24 11:58:16 -04:00
e9bee7fa48 FIX: nombres de variables 2020-07-24 11:58:09 -04:00
c40baaad3f Merge branch 'develop' 2020-07-24 11:47:39 -04:00
ac019aac3f FIX: bad return value 2020-07-24 11:47:25 -04:00
a82fdce64b Merge branch 'develop' 2020-07-22 23:08:52 -04:00
86ffb0b84c FIX 2020-07-22 23:08:34 -04:00
8126b1f67d Merge branch 'develop' 2020-07-22 22:57:48 -04:00
7899b9f6c8 FIX: Define 2020-07-22 22:56:40 -04:00
2 changed files with 6 additions and 5 deletions

View File

@ -3,6 +3,7 @@ namespace ProVM\Common\Define;
use \Model as BaseModel; use \Model as BaseModel;
use ProVM\Common\Alias\Model as ModelInterface; use ProVM\Common\Alias\Model as ModelInterface;
use ProVM\Common\Factory\Model as ModelFactory;
abstract class Model extends BaseModel implements ModelInterface { abstract class Model extends BaseModel implements ModelInterface {
const SELF_KEY = 'self_key'; const SELF_KEY = 'self_key';
@ -12,7 +13,7 @@ abstract class Model extends BaseModel implements ModelInterface {
const SELF_CONNECT_KEY = 'self_connect_key'; const SELF_CONNECT_KEY = 'self_connect_key';
const SIBLING_CONNECT_KEY = 'sibling_connect_key'; const SIBLING_CONNECT_KEY = 'sibling_connect_key';
public function getTable() { public function getTable(): string {
return static::$_table; return static::$_table;
} }
@ -60,10 +61,10 @@ abstract class Model extends BaseModel implements ModelInterface {
], [ ], [
Model::PARENT_KEY => 'id' Model::PARENT_KEY => 'id'
]); ]);
$parent_table = (new $parent_class())->getTable(); $parent_table = (new $parent_model_class())->getTable();
return $this->factory return $this->factory
->find($parent_model_class) ->find($parent_model_class)
->wherer([ ->where([
[ [
$relation_definitions[Model::PARENT_KEY], $relation_definitions[Model::PARENT_KEY],
$this->{$relation_definitions[Model::SELF_KEY]} $this->{$relation_definitions[Model::SELF_KEY]}
@ -81,7 +82,7 @@ abstract class Model extends BaseModel implements ModelInterface {
Model::SELF_KEY => 'id', Model::SELF_KEY => 'id',
Model::SIBLING_KEY => 'id' Model::SIBLING_KEY => 'id'
]); ]);
$sibling_table = (new $sibling_class())->getTable(); $sibling_table = (new $sibling_model_class())->getTable();
return $this->find($sibling_model_class) return $this->find($sibling_model_class)
->select([ ->select([
[ [

View File

@ -86,7 +86,7 @@ class Model {
]; ];
$this->conditions []= $cond; $this->conditions []= $cond;
} }
return $this->conditions; return $this;
} }
protected $grouping; protected $grouping;
public function group($groups): Model { public function group($groups): Model {