/** * Deletes this record (no checks) * Delete method for fields deleting also fieldvalues, and the data column(s) in the comprofiler table. * * @param int $oid Key id of row to delete (otherwise it's the one of $this) * @return boolean TRUE if OK, FALSE if error */ public function delete( $oid = null ) { $k = $this->_tbl_key; if ( $oid ) { $this->$k = (int) $oid; } $fieldHandler = new cbFieldHandler(); $result = $fieldHandler->adaptSQL( $this, 'drop' ); if ( $result ) { //delete each field value related to a field $rowFieldValues = new FieldValueTable( $this->_db ); $result = $rowFieldValues->updateFieldValues( $this->$k, array() ); //Now delete the field itself without deleting the user data, preserving it for reinstall //$this->deleteColumn( $this->table, $this->name ); // this would delete the user data $result = parent::delete( $this->$k ) && $result; } return $result; }
/** * @param null|int $id * @return bool */ public function delete( $id = null ) { global $_PLUGINS; $_PLUGINS->trigger( 'activity_onBeforeDeleteEmote', array( &$this ) ); if ( ! parent::delete( $id ) ) { return false; } $_PLUGINS->trigger( 'activity_onAfterDeleteEmote', array( $this ) ); return true; }
public function delete( $oid = null ) { global $_PLUGINS; $_PLUGINS->trigger( 'cbconsultations_onBeforeDeleteconsultation', array( &$this, &$this ) ); if ( ! parent::delete( $oid ) ) { return false; } $_PLUGINS->trigger( 'cbconsultations_onAfterDeleteconsultation', array( $this, $this ) ); $this->updateOrder(); return true; }
/** * @param null|int $id * @return bool */ public function delete( $id = null ) { global $_CB_framework, $_PLUGINS; $_PLUGINS->trigger( 'gj_onBeforeDeleteCategory', array( &$this ) ); if ( ! parent::delete( $id ) ) { return false; } // Delete groups in this category: $query = 'SELECT *' . "\n FROM " . $this->getDbo()->NameQuote( '#__groupjive_groups' ) . "\n WHERE " . $this->getDbo()->NameQuote( 'category' ) . " = " . (int) $this->get( 'id' ); $this->getDbo()->setQuery( $query ); $groups = $this->getDbo()->loadObjectList( null, '\CB\Plugin\GroupJive\Table\GroupTable', array( $this->getDbo() ) ); /** @var GroupTable[] $groups */ foreach ( $groups as $group ) { $group->delete(); } // Delete canvas and logo: if ( $this->get( 'canvas' ) || $this->get( 'logo' ) ) { CBGroupJive::deleteDirectory( $_CB_framework->getCfg( 'absolute_path' ) . '/images/comprofiler/plug_cbgroupjive/' . (int) $this->get( 'id' ) ); } $_PLUGINS->trigger( 'gj_onAfterDeleteCategory', array( $this ) ); return true; }