Beispiel #1
0
 /**
  * Called from admin element controller when element is removed
  *
  * @param   bool  $drop  has the user elected to drop column?
  *
  * @return  bool  save ok or not
  */
 public function onRemove($drop = false)
 {
     $this->deleteJoins((int) $this->_id);
     parent::onRemove($drop);
 }
Beispiel #2
0
	function onRemove($drop = false)
	{
		$db = FabrikWorker::getDbo();
		$orig_id = (int)$this->_id;
		if (!empty($orig_id)) {
			$db->setQuery("DELETE FROM #__{package}_joins WHERE element_id = ".$orig_id);
			$db->query();
			$db->setQuery("
				SELECT j.id AS jid
				FROM #__{package}_elements AS e
				LEFT JOIN #__{package}_joins AS j ON j.element_id = e.id
				WHERE e.parent_id = $orig_id
			");
			$join_ids = $db->loadResultArray();
			if (!empty($join_ids)) {
				$db->setQuery("DELETE FROM #__fabrik_joins WHERE id IN (" . implode(',', $join_ids) . ")");
			}
		}
		parent::onRemove($drop);
	}