
Öffentliche Methoden | |
| Link ($objectid='') | |
| load () | |
| delete () | |
| save () | |
| getProperties () | |
| getType () | |
| add () | |
Öffentliche Attribute | |
| $linkid | |
| $linkedObjectId = 0 | |
| $url = '' | |
| $isLinkToUrl = false | |
| $isLinkToObject = false | |
Definiert in Zeile 42 der Datei Link.class.php.
| Link::add | ( | ) |
Definiert in Zeile 151 der Datei Link.class.php.
Benutzt $db, db_connection() und Object::objectAdd().
00152 { 00153 $this->objectAdd(); 00154 00155 $db = db_connection(); 00156 00157 $sql = new Sql('SELECT MAX(id) FROM {t_link}'); 00158 $this->linkid = intval($db->getOne($sql->query))+1; 00159 00160 $sql = new Sql('INSERT INTO {t_link}'. 00161 ' (id,objectid,url,link_objectid)'. 00162 ' VALUES( {linkid},{objectid},{url},{linkobjectid} )' ); 00163 $sql->setInt ('linkid' ,$this->linkid ); 00164 $sql->setInt ('objectid' ,$this->objectid ); 00165 00166 if ( $this->isLinkToObject ) 00167 { 00168 $sql->setInt ('linkobjectid',$this->linkedObjectId ); 00169 $sql->setNull('url' ); 00170 } 00171 else 00172 { 00173 $sql->setNull ('linkobjectid'); 00174 $sql->setString('url',$this->url ); 00175 } 00176 00177 $db->query( $sql->query ); 00178 }
| Link::delete | ( | ) |
Definiert in Zeile 88 der Datei Link.class.php.
Benutzt $db, db_connection() und Object::objectDelete().
00089 { 00090 $db = db_connection(); 00091 00092 // Verknüpfung löschen 00093 $sql = new Sql( 'DELETE FROM {t_link} '. 00094 ' WHERE objectid={objectid}' ); 00095 $sql->setInt( 'objectid',$this->objectid ); 00096 00097 $db->query( $sql->query ); 00098 00099 $this->objectDelete(); 00100 }
| Link::getProperties | ( | ) |
Erneute Implementation von Object.
Definiert in Zeile 132 der Datei Link.class.php.
00133 { 00134 return array_merge( parent::getProperties(), 00135 Array( 'objectid' =>$this->objectid, 00136 'linkobjectid' =>$this->linkedObjectId, 00137 'url' =>$this->url, 00138 'isLinkToUrl' =>$this->isLinkToUrl, 00139 'isLinkToObject' =>$this->isLinkToObject) ); 00140 }
| Link::getType | ( | ) |
Typ des Objektes ermitteln
Erneute Implementation von Object.
Definiert in Zeile 143 der Datei Link.class.php.
| Link::Link | ( | $ | objectid = '' |
) |
Definiert in Zeile 50 der Datei Link.class.php.
Benutzt Object::$objectid und Object::Object().
00051 { 00052 $this->Object( $objectid ); 00053 $this->isLink = true; 00054 $this->isLinkToObject = false; 00055 }
| Link::load | ( | ) |
Laden des Objektes
Erneute Implementation von Object.
Definiert in Zeile 59 der Datei Link.class.php.
Benutzt $db, db_connection() und Object::objectLoad().
00060 { 00061 $db = db_connection(); 00062 00063 $sql = new Sql( 'SELECT *'. 00064 ' FROM {t_link}'. 00065 ' WHERE objectid={objectid}' ); 00066 $sql->setInt( 'objectid',$this->objectid ); 00067 $row = $db->getRow( $sql->query ); 00068 00069 $this->url = $row['url']; 00070 $this->linkedObjectId = $row['link_objectid']; 00071 00072 if ( is_numeric( $this->linkedObjectId ) ) 00073 { 00074 $this->isLinkToUrl = false; 00075 $this->isLinkToObject = true; 00076 } 00077 else 00078 { 00079 $this->isLinkToUrl = true; 00080 $this->isLinkToObject = false; 00081 } 00082 00083 $this->objectLoad(); 00084 }
| Link::save | ( | ) |
Definiert in Zeile 104 der Datei Link.class.php.
Benutzt $db, $SESS, db_connection() und Object::objectSave().
00105 { 00106 global $SESS; 00107 $db = db_connection(); 00108 00109 $sql = new Sql('UPDATE {t_link} SET '. 00110 ' url = {url},'. 00111 ' link_objectid = {linkobjectid}'. 00112 ' WHERE objectid={objectid}' ); 00113 $sql->setInt ('objectid' ,$this->objectid ); 00114 00115 if ( $this->isLinkToObject ) 00116 { 00117 $sql->setInt ('linkobjectid',$this->linkedObjectId ); 00118 $sql->setNull('url' ); 00119 } 00120 else 00121 { 00122 $sql->setNull ('linkobjectid'); 00123 $sql->setString('url',$this->url ); 00124 } 00125 00126 $db->query( $sql->query ); 00127 00128 $this->objectSave(); 00129 }
| Link::$isLinkToObject = false |
Definiert in Zeile 48 der Datei Link.class.php.
| Link::$isLinkToUrl = false |
Definiert in Zeile 47 der Datei Link.class.php.
| Link::$linkedObjectId = 0 |
Definiert in Zeile 45 der Datei Link.class.php.
| Link::$linkid |
Definiert in Zeile 44 der Datei Link.class.php.
| Link::$url = '' |
Definiert in Zeile 46 der Datei Link.class.php.
1.5.8