From 92481a62ac0402fc3612ebd319ddb738654f7057 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Fri, 24 May 2019 13:33:14 +0200 Subject: [PATCH] Added code to git in order to push for the weekend --- src/admin/common/abstract/model/factory.php | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/admin/common/abstract/model/factory.php b/src/admin/common/abstract/model/factory.php index 1155c6c..fc0b52b 100644 --- a/src/admin/common/abstract/model/factory.php +++ b/src/admin/common/abstract/model/factory.php @@ -47,6 +47,44 @@ abstract class AbstractCommonClubsModelFactory public abstract function getTableName(); public abstract function getClassName(); + // TODO Als Klassen formulieren + /* + * This method returns the relevant join operations on the data. + * The return value is an associated arrray whose keys are the names of the tables in the join. + * Each value of such joins is again an associative array. + * These arrays have the following entries: + * - alias: The alias name of the table to use. Mandatory + * - type: The type of the join. Can be inner, left, right or outer. Defaults to inner. + * - on: Join constraint as a string representation. + * - cols: The columns to insert in the query. Same structure as fetchAttributes() method + * + * Example: + * array( + * 'mytable'=>array( + * 'alias'=>'t1', + * 'type'=>'left', + * 'on'=>'main.id = t1.clubid', + * 'cols'=>array( + * 'name'=>array(), + * 'count'=>array('type'=>'int', 'col'=>'numElements' + * ) + * ) + * ) + */ + protected function fetchJoins() + { + return array(); + } + + private $joins = null; + public function getAttributes($force = False) + { + if($this->joins === null || $force) + $this->joins = $this->fetchJoins(); + + return $this->joins; + } + /** * * @param string $condition