Ich habe nun folgendes ohne funktionierendes Resultat gemacht:
Dass ist meine class.layout.php, welche ich um die cApiLayoutShareCollection und cApiLayoutShare erweitert habe.
Code: Alles auswählen
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
* Layout class
*
* Requirements:
* @con_php_req 5.0
*
*
* @package Contenido Backend classes
* @version 1.0
* @author Timo Hummel
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
* {@internal
* created 2004-08-07
*
* $Id: class.layout.php 1199 2010-08-24 14:31:44Z timo.trautmann $:
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
cInclude("classes", "class.genericdb.php");
class cApiLayoutCollection extends ItemCollection
{
function cApiLayoutCollection ()
{
global $cfg;
parent::ItemCollection($cfg["tab"]["lay"], "idlay");
$this->_setItemClass("cApiLayout");
$this->_setJoinPartner("cApiLayoutShareCollection");
}
function create ($title)
{
global $client;
$item = parent::create();
$item->set("name", $title);
$item->set("idclient", $client);
$item->store();
return ($item);
}
}
class cApiLayout extends Item
{
function cApiLayout ()
{
global $cfg;
parent::Item($cfg["tab"]["lay"], "idlay");
$this->setFilters(array(), array());
}
}
class cApiLayoutShareCollection extends ItemCollection
{
function cApiLayoutShareCollection ()
{
global $cfg;
parent::ItemCollection($cfg["tab"]["lay_share"], "id_idlay");
$this->_setItemClass("cApiLayoutShare");
}
}
class cApiLayoutShare extends Item
{
function cApiLayoutShare ()
{
global $cfg;
parent::Item($cfg["tab"]["lay_share"], "id_idlay");
$this->setFilters(array(), array());
}
}
?>
Meine include.lay_overview.php habe ich folgendermaßen angepasst:
Code: Alles auswählen
$sWhere = 'idlay = ' . $cfg['tab']['lay_share'] . '.id_idlay AND ' .
$cfg['tab']['lay_share'] .'.id_idclient = ' .Contenido_Security::toInteger($client).' AND '.
'idclient = ' .Contenido_Security::toInteger($client).
' GROUP BY idlay';
$layouts = new cApiLayoutCollection;
#$layouts->select("idclient = '$client'","","name ASC");
$layouts->select("$sWhere","","name ASC");
Rufe ich nun meine Layout-Seite auf, erhalte ich bei einem var_dump auf $layouts unter anderem folgende Infos:
Code: Alles auswählen
object(cApiLayoutCollection)[36]
public 'table' => string 'con_lay' (length=7)
public 'primaryKey' => string 'idlay' (length=5)
public 'db' =>
object(DB_Contenido)[37]
public 'Halt_On_Error' => string 'report' (length=6)
public 'Auto_Free' => int 0
public 'Debug' => int 0
public 'Seq_Table' => string '' (length=0)
public 'Record' =>
array
empty
public 'Row' => int 0
public 'Errno' => int 1054
public 'Error' => string 'Unknown column 'con_lay_share.id_idlay' in 'where clause'' (length=57)
public 'type' => string 'mysql' (length=5)
public 'revision' => string '1.2' (length=3)
public 'Link_ID' => resource(61, mysql link)
public 'Query_ID' => boolean false
public 'lasterror' => null
public 'cache' => null
public 'lifetime' => int 10
public '_itemClass' => string 'cApiLayout' (length=10)
public '_iteratorItem' => null
public '_JoinPartners' =>
array
0 => string 'capilayoutsharecollection' (length=25)
public '_forwardJoinPartners' =>
array
empty
public '_whereRestriction' => null
public '_innerGroupConditions' =>
array
empty
public '_groupConditions' =>
array
'share0' =>
array
'share1' => string 'OR' (length=2)
public '_resultFields' =>
array
empty
public 'properties' => null
public 'virgin' => boolean true
public '_encoding' => null
public '_aOperators' =>
array
0 => string '=' (length=1)
1 => string '!=' (length=2)
2 => string '<>' (length=2)
3 => string '<' (length=1)
4 => string '>' (length=1)
5 => string '<=' (length=2)
6 => string '>=' (length=2)
7 => string 'LIKE' (length=4)
8 => string 'DIACRITICS' (length=10)
public '_limitStart' => int 0
public '_limitCount' => int 0
public '_links' =>
array
empty
public '_where' =>
array
'global' =>
array
empty
'groups' =>
array
'share0' =>
array
...
'share1' =>
array
...
public '_driver' =>
object(gdbMySQL)[38]
public '_sEncoding' => null
public '_oItemClassInstance' =>
object(cApiLayout)[39]
public 'table' => string 'con_lay' (length=7)
public 'db' =>
object(DB_Contenido)[40]
...
public 'primaryKey' => string 'idlay' (length=5)
public 'values' => null
public 'modifiedValues' => null
public 'lasterror' => null
public 'virgin' => boolean true
public 'cache' => null
public 'lifetime' => int 10
public 'properties' => null
public 'oldPrimaryKey' => null
public '_arrInFilters' =>
array
...
public '_arrOutFilters' =>
array
...
public '_metaObject' => null
public '_itemClassInstance' =>
object(cApiLayout)[39]
public 'table' => string 'con_lay' (length=7)
public 'db' =>
object(DB_Contenido)[40]
public 'Halt_On_Error' => string 'report' (length=6)
public 'Auto_Free' => int 0
public 'Debug' => int 0
public 'Seq_Table' => string '' (length=0)
public 'Record' =>
array
...
public 'Row' => null
public 'Errno' => int 0
public 'Error' => string '' (length=0)
public 'type' => string 'mysql' (length=5)
public 'revision' => string '1.2' (length=3)
public 'Link_ID' => int 0
public 'Query_ID' => int 0
public 'primaryKey' => string 'idlay' (length=5)
public 'values' => null
public 'modifiedValues' => null
public 'lasterror' => null
public 'virgin' => boolean true
public 'cache' => null
public 'lifetime' => int 10
public 'properties' => null
public 'oldPrimaryKey' => null
public '_arrInFilters' =>
array
empty
public '_arrOutFilters' =>
array
empty
public '_metaObject' => null
public '_lastSQL' => string 'SELECT idlay FROM con_lay WHERE idlay = con_lay_share.id_idlay AND con_lay_share.id_idclient = 10 AND idclient = 10 GROUP BY idlay ORDER BY name ASC' (length=148)
public '_mode' => string 'manual' (length=6)
Hier besonders seltsam:
public '_lastSQL' => string 'SELECT idlay FROM con_lay WHERE idlay = con_lay_share.id_idlay AND con_lay_share.id_idclient = 10 AND idclient = 10 GROUP BY idlay ORDER BY name ASC' (length=148)... weil kein Join drin is, und die Zeile
public 'Error' => string 'Unknown column 'con_lay_share.id_idlay' in 'where clause'' (length=57), weil die DB und die zeile in jedem Fall existiert (resultiert aber wahrscheinlich aus dem fehlenden Join.
Also für weitere Tipps wäre ich sehr dankbar.
Vielleicht findet sich ja ein 4fb-Entwickler der helfen kann.