Source for file LInterlinkCore.php
Documentation is available at LInterlinkCore.php
* @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
* @copyright 2005, diemeisterei GmbH. All rights reserved.
* @author $Author: schmunk $
* @version $Revision: 382 $ $Date: 2006-11-16 11:41:32 +0100 (Thu, 16 Nov 2006) $
* @package Phundament.Packages
Prado :: setPathOfAlias("LInterlink", dirname(__FILE__ ));
Prado :: using("LInterlink.db.propel.*");
Prado :: using("LInterlink.db.propel.l_interlink.*");
* @package System.Collections
private $_custom_data = null;
public function __construct($rank = null, $custom_data = null)
$this->_custom_data = $custom_data;
return $this->_custom_data;
* @package System.Collections
public function __construct($key, $category, $source_id, $records)
$this->_category = $category;
$this->_source_id = $source_id;
foreach($records as $rec)
$this->add($rec->getDestinationId(), $entry);
$conn = Prado::getApplication()->getModule("database")->getConnection("l_interlink", "propel");
$c->add(LInterlinkPeer :: KEY, $this->_key);
$c->add(LInterlinkPeer :: CATEGORY, $this->_category);
$c->add(LInterlinkPeer :: SOURCE_ID, $this->_source_id);
LInterlinkPeer :: doDelete($c, $conn);
foreach($this as $dest_id => $entry)
$r->setCategory($this->_category);
$r->setSourceId($this->_source_id);
$r->setDestinationId($dest_id);
$r->setRank($entry->getRank());
$cust = $entry->getCustomData();
$r->setCustomData($cust);
public function init($config)
Prado::trace("Initializing interlink module ...", "Lithron.LInterlink");
$links = $config->getElementsByTagName("link");
$categories = $link-> getElementsByTagName("category");
foreach($categories as $category)
$statements = $category-> getElements();
foreach($statements as $statement)
switch($statement->getTagName())
$cat_akku["selection"] = $statement->getAttribute("class");
$link_akku[$category->getAttribute("id")] = $cat_akku;
$this->_links[$link->getAttribute("key")] = $link_akku;
if (isset ($this->_links[$link]))
if (isset ($this->_links[$link]) &&
isset ($this->_links[$link][$category]) &&
isset ($this->_links[$link][$category]["selection"]))
return $this->_links[$link][$category]["selection"];
$conn = $this->Application->getModule("database")->getConnection("l_interlink", "propel");
$c->add(LInterlinkPeer :: KEY, $key);
$c->add(LInterlinkPeer :: CATEGORY, $category);
$c->add(LInterlinkPeer :: SOURCE_ID, $source_id);
$c->addAscendingOrderByColumn(LInterlinkPeer :: RANK);
$records = LInterlinkPeer :: doSelect($c, $conn);
return new LRelation($key, $category, $source_id, $records);
|