/** * Clear this store addons * * @return int number of addons removed */ public function clear($type = 'plugin') { /* Remove old items from this store */ $criteria = new Criteria(AddonsManagerPeer::DATABASE_NAME); $criteria->add(AddonsManagerPeer::STORE_ID, $this->getStoreId(), Criteria::EQUAL); $criteria->add(AddonsManagerPeer::ADDON_TYPE, $type, Criteria::EQUAL); return AddonsManagerPeer::doDelete($criteria); }
/** * Removes this object from datastore and sets delete attribute. * * @param Connection $con * @return void * @throws PropelException * @see BaseObject::setDeleted() * @see BaseObject::isDeleted() */ public function delete($con = null) { if ($this->isDeleted()) { throw new PropelException("This object has already been deleted."); } if ($con === null) { $con = Propel::getConnection(AddonsManagerPeer::DATABASE_NAME); } try { $con->begin(); AddonsManagerPeer::doDelete($this, $con); $this->setDeleted(true); $con->commit(); } catch (PropelException $e) { $con->rollback(); throw $e; } }