本文整理匯總了PHP中ContentPeer::doDelete方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContentPeer::doDelete方法的具體用法?PHP ContentPeer::doDelete怎麽用?PHP ContentPeer::doDelete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ContentPeer
的用法示例。
在下文中一共展示了ContentPeer::doDelete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: removeContent
function removeContent($ConCategory, $ConParent, $ConId)
{
try {
$c = new Criteria();
$c->add(ContentPeer::CON_CATEGORY, $ConCategory);
$c->add(ContentPeer::CON_PARENT, $ConParent);
$c->add(ContentPeer::CON_ID, $ConId);
$result = ContentPeer::doSelectRS($c);
$result->next();
$row = $result->getRow();
while (is_array($row)) {
ContentPeer::doDelete(array($ConCategory, $ConParent, $ConId, $row[3]));
$result->next();
$row = $result->getRow();
}
} catch (Exception $e) {
throw $e;
}
}
示例2: delete
/**
* 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(ContentPeer::DATABASE_NAME);
}
try {
$con->begin();
ContentPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
示例3: Publisher
$oDataset->next();
$aRow1 = $oDataset->getRow();
if (is_array($aRow1)) {
$G_PUBLISH = new Publisher();
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'SETUP';
$G_SUB_MENU = 'setup';
$G_ID_SUB_MENU_SELECTED = 'LANGUAGES';
//$aMessage['MESSAGE'] = G::LoadTranslation('CANT_DEL_LANGUAGE');//"you can't delete this language is in use";
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/showMessage', '', $aMessage );
//G::RenderPage('publishBlank', 'blank');
G::SendTemporalMessage('CANT_DEL_LANGUAGE', 'error', 'labels');
G::header('location: languages');
} else {
/*the reason why comment it was because when delete some language,we're losing some labels about this language*/
$oCriteria = new Criteria('workflow');
$oCriteria->add(ContentPeer::CON_LANG, $_GET['LAN_ID']);
ContentPeer::doDelete($oCriteria);
/*
$oCriteria1 = new Criteria('workflow');
$oCriteria1->add(LanguagePeer::LAN_ENABLED, 0);
$oCriteria2 = new Criteria('workflow');
$oCriteria2->add(LanguagePeer::LAN_ID, $_GET['LAN_ID']);
LanguagePeer::doUpdate($oCriteria2, $oCriteria1, Propel::getConnection('workflow'));
*/
$aLanguage['LAN_ID'] = $_GET['LAN_ID'];
$aLanguage['LAN_ENABLED'] = 0;
$oLanguage = new Language();
$oLanguage->update($aLanguage);
G::header('Location: languages');
}
示例4: delete
/**
* Removes this object from datastore and sets delete attribute.
*
* @param PropelPDO $con
* @return void
* @throws PropelException
* @see BaseObject::setDeleted()
* @see BaseObject::isDeleted()
*/
public function delete(PropelPDO $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(ContentPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
try {
$ret = $this->preDelete($con);
// symfony_behaviors behavior
foreach (sfMixer::getCallables('BaseContent:delete:pre') as $callable) {
if ($ret = call_user_func($callable, $this, $con)) {
return;
}
}
if ($ret) {
ContentPeer::doDelete($this, $con);
$this->postDelete($con);
// symfony_behaviors behavior
foreach (sfMixer::getCallables('BaseContent:delete:post') as $callable) {
call_user_func($callable, $this, $con);
}
$this->setDeleted(true);
$con->commit();
} else {
$con->commit();
}
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}