Inkonsistenzen in cAPI
Verfasst: Di 1. Jan 2008, 22:31
Laut API-Dokumentation und laut Implementierung in Item sollte LoadByPrimaryKey() einen Rückgabewert über den Erfolg liefern. Diverse überladene Implementierungen tun das nicht.
classes/contenido/class.client.php Zeile 151-157:
muss heißen:
Dasselbe auch in classes/contenido/class.clientlang.php Zeile 70-76:
muss heißen:
classes/contenido/class.module.php Zeile 85-100:
vielleicht so:
und schließlich noch classes/class.category.php Zeile 46-85
so:
classes/contenido/class.client.php Zeile 151-157:
Code: Alles auswählen
function loadByPrimaryKey ($value)
{
if (parent::loadByPrimaryKey($value) == true)
{
$this->idclient = $value;
}
}
Code: Alles auswählen
function loadByPrimaryKey ($value)
{
if (parent::loadByPrimaryKey($value) == true)
{
$this->idclient = $value;
return true;
}
return false;
}
Dasselbe auch in classes/contenido/class.clientlang.php Zeile 70-76:
Code: Alles auswählen
function loadByPrimaryKey ($iID)
{
if (parent::loadByPrimaryKey($iID) == true)
{
$this->idclient = $this->get("idclient");
}
}
Code: Alles auswählen
function loadByPrimaryKey ($iID)
{
if (parent::loadByPrimaryKey($iID) == true)
{
$this->idclient = $this->get("idclient");
return true;
}
return false;
}
Code: Alles auswählen
function loadByPrimaryKey ($id)
{
parent::loadByPrimaryKey($id);
if ($this->_shouldLoadFromFiles())
{
global $cfg;
$sRootPath = $cfg['path']['contenido'] . $cfg['path']['modules'] . $this->get("idclient")."/" . $this->get("idmod").".xml";
if (file_exists($sRootPath))
{
$this->import($sRootPath);
}
}
}
Code: Alles auswählen
function loadByPrimaryKey ($id)
{
if (parent::loadByPrimaryKey($id)){
if ($this->_shouldLoadFromFiles())
{
global $cfg;
$sRootPath = $cfg['path']['contenido'] . $cfg['path']['modules'] . $this->get("idclient")."/" . $this->get("idmod").".xml";
if (file_exists($sRootPath))
{
$this->import($sRootPath);
}
}
return true;
}
return false;
}
Code: Alles auswählen
function loadByPrimaryKey ($key)
{
parent::loadByPrimaryKey($key);
/* Load all child language items */
$catlangs = new CategoryLanguageCollection;
$catlangs->select("idcat = '$key'");
while ($item = $catlangs->next())
{
$this->lang[$item->get("idlang")] = $item;
}
}
Code: Alles auswählen
function loadByPrimaryKey ($key)
{
if (parent::loadByPrimaryKey($key))
{
/* Load all child language items */
$catlangs = new CategoryLanguageCollection;
$catlangs->select("idcat = '$key'");
while ($item = $catlangs->next())
{
$this->lang[$item->get("idlang")] = $item;
}
return true;
}
return false;
}